S
C-reator schrieb:
Darf man fragen, worauf sich "5.2.5/4" bezieht? Durch schlagfertiges Googeln habe ich herausgefunden, dass es um den "C++ Standard" geht (oder vermutlicht eine Erweiterung dessen?) ...
Ja, sorry! Hätte das erwähnen können. ISO 14882:2003 "Programming Language C++", Abschnitt 5.2.5 Paragraph 4, Unterpunkt 3:
If E2 is a (possibly overloaded) member function, function overload resolution (13.3) is used to determine whether E1.E2 refers to a static or a non-static member function.
If it refers to a static member function, and the type of E2 is “function of parameter-type-list returning T”, then E1.E2 is an lvalue; the expression designates the static member function. The type of E1.E2 is the same type as that of E2, namely “function of parameter-type-list returning T”.
Otherwise, if E1.E2 refers to a non-static member function, and the type of E2 is “function of parametertype-list cv returning T”, then E1.E2 is not an lvalue. The expression designates a non-static member function. The expression can be used only as the left-hand operand of a member function call (9.3). [ Note: any redundant set of parentheses surrounding the expression is ignored (5.1). —end note ] The type of E1.E2 is “function of parameter-type-list cv returning T”.
...wobei der letzte Satz aber auch mein "Den Typ dieses Ausdrucks kann man gar nicht aufschreiben" widerlegt. Zumindest ist der Typ (wenn "cv" nicht leer ist) kein Typ in dem Sinne, dass ich ein typedef dafür anlegen könnte.
Gruß,
SP