|
From: Ioannis V. <no...@ho...> - 2003-02-18 09:08:06
|
Let's clear this one for all. What the standard says:=0D =0D "A pointer to member shall not point to a static member of a class (9.4),= a member with reference type, or =93cv void.=94 [Note: see also 5.3 and 5.5= =2E The type =93pointer to member=94 is distinct from the type =93pointer=94, tha= t 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 =93refere= nce to member=94 type in C++. ]"=0D =0D "A pointer to member is only formed when an explicit & is used and its operand is a qualified id not enclosed in parentheses. [Note: that is, th= e expression &(qualifiedid),=0D where the qualified id is enclosed in parentheses, does not form an expression of type =93pointer to member.=94 Neither does qualified id, be= cause there is no implicit conversion from a qualified id for a nonstatic membe= r function to the type =93pointer to member function=94 as there is from an= lvalue of function type to the type =93pointer to function=94 (4.3). Nor is & unqualified id a pointer to member, even within the scope of the unqualif= ied id=92s class. ]"=0D =0D =0D In summary pointers to member functions are not equivalent to pointers to regular functions. They can be (and usually are) implemented differently.= =0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |