The binary operator .* binds its second operand, which shall be
of type “pointer to member of T” to its first operand, which shall be
a glvalue
of
class T or of a class of which T is an unambiguous and
accessible base class.
The result is an object or a function of the type
specified by the second operand.
The binary operator ->* binds its second operand, which shall be
of type “pointer to member of T” to its first operand, which shall be of
type “pointer to U”
where U is either T or
a class of which T
is an unambiguous and accessible base class.
The expression E1->*E2 is converted into the equivalent form
(*(E1)).*E2.
The restrictions on cv-qualification, and the manner in which
the cv-qualifiers of the operands are combined to produce the
cv-qualifiers of the result, are the same as the rules for
E1.E2 given in [expr.ref].
It is not possible to use a pointer to member that refers to a
mutable member to modify a const class object.
For
example,
struct S {
S() : i(0) { }
mutable int i;
};
void f()
{
const S cs;
int S::* pm = &S::i; // pm refers to mutable member S::ics.*pm = 88; // ill-formed: cs is a const object
}
calls the member function denoted by ptr_to_mfct for the object
pointed to by ptr_to_obj.
—end example
]
In a .* expression whose object expression is an rvalue, the program is
ill-formed if the second operand is a pointer to member function with
ref-qualifier&.
In a .*
expression whose object expression is an lvalue, the program is ill-formed if the second
operand is a pointer to member function with ref-qualifier&&.
The result of a .* expression
whose second operand is a pointer to a data member is an lvalue if the first
operand is an lvalue and an xvalue otherwise.
The result of a .* expression whose
second operand is a pointer to a member function is a prvalue.
If the second operand is the null
member pointer value ([conv.mem]), the behavior is undefined.