[#bsl-shared_ptr-0a-operator_subs] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::operator[] :relfileprefix: ../../ :mrdocs: Return a reference providing modifiable access to the object at the specified `index` offset in the object referred to by this shared pointer. The behavior is undefined unless this shared pointer is not empty, `ELEMENT_TYPE` is not `void` (a compiler error will be generated if this operator is instantiated within the `shared_ptr<void>` class), and this shared pointer refers to an array of `ELEMENT_TYPE` objects. Instead of `element_type &`, we use `add_lvalue_reference<element_type>::type` for the return type because that allows people to instantiate `shared_ptr<cv_void>`, as long as they don't use this method. Note that this method is logically equivalent to `*(get() + index)`. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- add_lvalue_reference<element_type>::type operator[](ptrdiff_t index) const; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#