ISO/IEC 14882:2003 page 85: 5.5 Pointer-to-member operators

The pointer-to-member operators -> and .

The binary operator .* binds its second operand, which shall be of the type of "pointer to member of T" (where T is a completely-defined class type) to its first operand, which shall be 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.

成员指针操作符有两个 -> 和 .

“ .* ”是一个二元操作符,它将第二个参数bind到第一个参数上。其中第二个参数应该是一个指向第一个参数类型(T)的成员指针。而第一个参数应该是类型T的对象或是一个“没有歧义且可访问”的base sub-object。 这个操作符的运算结果是一个对象或函数。(注意:“这个操作符的结果”,而不是最终的结果)


If the dynamic type of the object does not contain the member to which the pointer refers, the behavior is undefined


If the second operand is the null pointer to member value, the behavior is undefined.


ISO/IEC 14882:2003 page 137: Pointer to member

The "pointer to member" is distinct from the type "pionter", that is, a pointer to member is declared only by the pointer to member declarator syntax, and never by the pointer declarator syntax.
There is no "reference-to-member" type in c++.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top