17.9 Overloading the Subscript
Operator
- Often defined on an indexable container (vector or
map)
- Explicit argument is the index
- Result is the value stored at the given position
- Return a reference to the value to get an L-value
- Must be a member function
- operator[][] does not exist
prev
|top
|next