Member access operators
Min standard notice:
Accesses a member of its operand.
# Declarations
T& operator[](T*, std::ptrdiff_t);
T& operator[](std::ptrdiff_t, T*);
# Notes
Feature-test macro Value Std Feature __cpp_multidimensional_subscript 202110L (C++23) Multidimensional subscript operator
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| CWG 1213 | C++11 | subscripting an array rvalue resulted in lvalue | reclassified as xvalue |
| CWG 1458 | C++98 | applying & to an lvalue of incomplete class type whichdeclares operator& resulted in undefined behavior | it is unspecifiedwhich & is used |
| CWG 1642 | C++98 | the rhs in built-in pointer-to-member access operators could be an lvalue | can only be an rvalue |
| CWG 1800 | C++98 | when applying & to a non-static data member of amember anonymous union, it was unclear whetherthe anonymous union take a part in the result type | the anonymous unionis not included inthe result type |
| CWG 2614 | C++98 | the result of E1.E2 was unclear if E2 is a reference member or enumerator | made clear |
| CWG 2725 | C++98 | if E2 is a static member function, E1.E2 is well-formedeven if it is not the left hand opreand of operator() | E1.E2 is ill-formedin this case |
| CWG 2748 | C++98 | the behavior of E1->E2 was unclear if E1 is anull pointer and E2 refers to a static member | the behavior isundefined in this case |
| CWG 2813 | C++98 | E1 was not a discarded-value expression ifE1.E2 names a static member or enumeration | it is |
| CWG 2823 | C++98 | the behavior of *expr was unclear if exprdoes not point to an object or function | made clear |