What does & Type :: variable mean?
int main()
{
struct Bob
{
int a;
};
&Bob::a;
}
What does it mean &Bob::a
? Bob is a type, not an instance, so he takes an address?
It is a pointer to a member of the class. According to the standard (N4296, 5.3.1):
The result of a unary operator
&
is a pointer to its operand. The operand must be lvalue or identified-id. If the operand is a qualified identifier naming a non-static or variant member ofm
some classC
with a typeT
, the result is of type "pointer to member ofC
type classT
" and is a denoting prvalueC::m
.