What is the correct term for ->,->* and .* operators?
Wikipedia refers to them as:
-> Member b of object pointed to by a
->* Member po开发者_开发知识库inted to by b of object pointed to by a .* Member pointed to by b of object a
But I need to refer to them without using "a" and "b". Do they have any names?
The standard has calls ->*
and .*
"pointer-to-member operators" (5.5). The former expects the first operand to be of pointer type, the second of class type.
Similarly, ->
and .
are called "class member access" (5.2.5), or "dot" and "arrow".
If you're discussing them in conversation, I us the terms::
-> "Arrow" eg. "B-arrow-A"
->* "Arrow-star" eg. "B-arrow-star-A"
.* "Dot-star" eg. "B-dot-star-A"
When writing about them, I prefer the terms others have mentioned.
I believe it is
- member access operator (–>)
pointer-dereference operator (*)
Pointer-to-member selection (.*) [according to here, at least]
精彩评论