std::unique_ptr<T,Deleter>::operator[] (3) - Linux Manuals
std::unique_ptr<T,Deleter>::operator[]: std::unique_ptr<T,Deleter>::operator[]
NAME
std::unique_ptr<T,Deleter>::operator[] - std::unique_ptr<T,Deleter>::operator[]
Synopsis
T& operator[](size_t i) const; (since C++11)
operator[] provides access to elements of an array managed by a unique_ptr.
The parameter i shall be less than the number of elements in the array; otherwise, the behavior is undefined.
Parameters
i - the index of the element to be returned
Return value
Returns the element at index i, i.e. get()[i].
Example
// Run this code
Output:
See also
get (public member function)