Overloading the Class Member Access Operator ->

From RAD Studio
Jump to: navigation, search

Go Up to Overloading Operator Functions Overview Index (C++)


postfix-expression -> primary-expression


The expression x->m, where x is a class X object, is interpreted as:


so that the function operator ->() must either return a pointer to a class object or return an object of a class for which operator -> is defined.

The operator ->() can only be overloaded as a nonstatic member function.

See Also