Article View: comp.std.c++
Article #3186Re: inconsistance in over.over
From: J. Stephen Adamczyk
Date: Thu, 01 Feb 1996 17:22
Date: Thu, 01 Feb 1996 17:22
35 lines
2405 bytes
2405 bytes
In article <4eo2mk$7tc@boy.nmd.msu.ru> krotoff@such.srcc.msu.su (Alexander Krotoff) writes: >There is small inconsistance in the Oct 95 WP: >----------------------------------------------------------------------- >13.4 Address of overloaded function [over.over] >In the example on the end of the section: > > int (X::*p5)(int) = &(X::f); // error: wrong syntax for</B> > // pointer to member</B> > int (*p6)(long) = &(X::f); // OK</B>1 > >Error: qualified-id enclosed in parentheses. >----------------------------------------------------------------------- >5.3.1 Unary operators [expr.unary.op] > >3 A pointer to member is only formed when an explicit & is used and > its operand is a qualified-id not enclosed in parentheses. >----------------------------------------------------------------------- > >I suppose the error is in the over.over. Why do you think there's an error? The point of the example in over.over is that something like X::f can represent a set of overloaded functions, some of which are nonstatic member functions and some of which are static member functions. That set is subjected to overload resolution, and one of the functions is chosen. If the one chosen is a nonstatic member function, then the form used must be &X::f. But if the one chosen is a static member function, the form can be X::f or &X::f or &(X::f) etc., because any of those is a valid form for the address of a static member function. Steve Adamczyk Edison Design Group --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<DM3LI3.EJ1@edg.com>Path:
arc1-ca.pugleaf.net!fido.asd.sgi.com!austernReferences:
<4eo2mk$7tc@boy.nmd.msu.ru>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern From: jsa@edg.com (J. Stephen Adamczyk) Newsgroups: comp.std.c++ Subject: Re: inconsistance in over.over Date: 01 Feb 1996 09:22:45 PST Organization: Edison Design Group Inc. Approved: austern@isolde.mti.sgi.com Message-ID: <DM3LI3.EJ1@edg.com> References: <4eo2mk$7tc@boy.nmd.msu.ru> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: Thu, 1 Feb 1996 13:01:15 GMT Apparently-To: comp-std-c++@uunet.uu.net X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMRD2+Ey4NqrwXLNJAQFRqQIAmKowypwOGHGyMUkW9Vaz5uDufzlI/9M6 FAz+II65Koc0pZywBXYtoy5EAInOERGqbYQFf4TpJKfPR0d/dEjEyg== =wmUS Originator: austern@isolde.mti.sgi.com