cpp/memory/shared ptr/operator at

Index into the array pointed to by the stored pointer.

The behavior is undefined if the stored pointer is null or if is negative.

If (the template parameter of ) is an array type,  must be less than , otherwise the behavior is undefined.

Return value
A reference to the -th element of the array, i.e.,

Exceptions
Throws nothing.

Remarks
When is not an array type, it is unspecified whether this function is declared. If the function is declared, it is unspecified what its return type is, except that the declaration (although not necessarily the definition) of the function is guaranteed to be legal.