Talk:cpp/language/operator member access

Naming bikeshed
Since this page appears to be targeted by stylistic editing, let's decide how cppreference should name the operators listed here.

Current naming used here since the beginning:
 * [] "subscript operator" (until today mixed with "array subscript operator")
 * "indirection operator"
 * & "address-of operator" (just edited to "address" and reverted by me to "address-of")
 * . "member of object"
 * -> "member of pointer"
 * .* "pointer to member of object"
 * ->* "pointer to member of pointer"

ISO standard naming:
 * []
 * - "the subscript operator" (5.2.1[expr.sub]/1.64 8.3.4[dcl.array]/6, 26.6.2.4[valarray.access]/1
 * - "subscripting operator" (index, and, indirectly 13.5.5[over.sub]/1 and 5.2.1[expr.sub])


 * - "indirection operator" 24.5.3/1, index
 * - "dereference operator" only in obsolete revisions of the C++ standard, this bikeshed has been painted
 * - "dereference operator" only in obsolete revisions of the C++ standard, this bikeshed has been painted


 * - "The address-of operator" 9.6/3, index
 * - "the unary & operator" 4[conv]/8
 * - "the unary & operator" 4[conv]/8


 * - "dot operator" 5.2.4[expr.pseudo]/1, 5.2.5[expr.ref] 5.3.1/3
 * - "the class member access operator dot" 7.2/10
 * - "class member access operator" (when referring to both . and ->) 11.2/5, index
 * - "operator dot" n4477
 * - "operator dot" n4477


 * - "the arrow operator" 5.2.4[expr.pseudo]/1, 5.2.5[expr.ref], index
 * - "the class member access operator arrow" 7.2/10
 * - "class member access that uses ->" 13.5.6[over.ref]/1
 * - "operator->" index and many other places, but generally referring to overloaded operator
 * - "class member access operator" (when referring to both . and ->) 11.2/5, index
 * - "class member access operator" (when referring to both . and ->) 11.2/5, index


 * - "the binary operator .*" 5.5/2
 * - "the pointer to member operator .*" (5.5, index)
 * - "the pointer to member operator .*" (5.5, index)


 * - "the binary operator ->*" 5.5/3
 * - "the pointer to member operator ->*" (5.5, index)
 * - "the pointer to member operator ->*" (5.5, index)

Ideas? --Cubbi (talk) 15:04, 26 August 2015 (PDT)


 * I'm (perhaps unsurprisingly) okay with the naming used since the beginning. But regardless of what we all end up gravitating to, I think we should remember that this site can add a lot of value to the interblabs by translating standardese like "dot operator" to e.g. "member of object" (which I think is a little more approachable because it describes the semantics of the operator). --Nate (talk) 17:08, 26 August 2015 (PDT)


 * This is mainly to have a central point of reference to keep future edits in check. Personally the only issue I had with the naming here was with .* and ->*, which I call "dot-star" and "arrow-star" in real life (and I'm probably one of the few people (un?)fortunate enough to have to pronounce them in real life). "Pointer to member of pointer" brushes over the edge of enwiki:semantic saturation. --Cubbi (talk) 13:32, 27 August 2015 (PDT)

Is the term "member" in the page title standardized for entities other than class members? Because in the list of member access operators, the subscript, indirection and address-of operators are listed, in addition to the classic class member access operators (., ->, .*, ->*). For me a "member" is always a "class member", so I would rather entitle the page "Access operators" or "Entity access operators" rather than "Member access operators" which is misleading with the subscript, indirection and address-of operators.
 * Maggyero (talk) 05:25, 3 October 2015 (PDT).


 * I think it is a reasonable grouping. "Access" would be vague, "Entity access" even more so. Note that you are discussing navigation on a wiki, not something specified by the standard. --Cubbi (talk) 14:55, 4 October 2015 (PDT)


 * What bothers me with that grouping is that when somebody talks about a "member access operator" he always thinks about a "class member access operator" (,, and sometimes , —but these ones are better referred to as "pointer-to-member operators"), never about a subscript, nor an indirection nor an address-of operator. Indeed:
 * the subscript expression does not refer to a "member" of  but to a subobject (or element) of ;
 * the indirection expression does not refer to a "member" of  but to an object or function (which shall not be a member of a class!) pointed to by ;
 * the address-of expression does not refer to a "member" of  but to an object pointing to.
 * The supscript operator in this list has in common with the class member and pointer-to-member operators the fact that they all refer to a subentity, that is an entity inside the calling object, while the indirection and address-of operators refer to an entity outside the calling object and therefore have little to do with this group of operators. Thus what about renaming the page "Subentity access operators" or "Element access operators" and putting the indirection and address-of operators to the group of operators "Other"?
 * Maggyero (talk) 16:10, 8 October 2015 (PDT).

"It" in section "Built-in member access operators" is ambiguous

 * If a user-defined is provided, the  is called again on the value that it returns, recursively, until an  is reached that returns a plain pointer. After that, built-in semantics are applied to that pointer.

It is not clear what "it" refers to. According to section [over.ref ], "it" should refer to the left-hand side operand.

Studyingegret (talk) 04:21, 13 March 2023 (PDT)
 * Changed, let me know if you're satisfied --Ybab321 (talk) 05:35, 13 March 2023 (PDT)


 * It looks nice. Sorry for the late reply. Studyingegret (talk) 03:39, 15 March 2023 (PDT)