19. Special Operators
We are all special cases.
– Albert Camus
• Special Operators
Subscripting; Function Call; Dereferencing; Increment and Decrement; Allocation and Deallocation; User-Defined Literals
• A String Class
Essential Operations; Access to Characters; Representation; Member Functions; Helper Functions; Using Our String
Finding Friends; Friends and Members
Overloading is not just for arithmetic and logical operations. In fact, operators are crucial in the design of containers (e.g., vector and map; §4.4), “smart pointers” (e.g., unique_ptr and shared_ptr; §5.2.1), iterators (§4.5), and other classes concerned with resource management.
19.2. Special Operators