From -3034280826035724338
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,2011c154e12ede7e
X-Google-Attributes: gidf78e5,public
From: jsa@edg.com (J. Stephen Adamczyk)
Subject: Re: inconsistance in over.over
Date: 1996/02/01
Message-ID: <DM3LI3.EJ1@edg.com>#1/1
X-Deja-AN: 137621011
references: <4eo2mk$7tc@boy.nmd.msu.ru>
x-original-date: Thu, 1 Feb 1996 13:01:15 GMT
apparently-to: comp-std-c++@uunet.uu.net
organization: Edison Design Group Inc.
x-auth: PGPMoose V1.1 PGP comp.std.c++
newsgroups: comp.std.c++
originator: austern@isolde.mti.sgi.com

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. ]



