This is the mail archive of the
mailing list for the GCC project.
Re: c++/4047: assuming & on overloaded member functions
- To: gcc at gcc dot gnu dot org
- Subject: Re: c++/4047: assuming & on overloaded member functions
- From: "Yu Zhang/CanWest/IBM" <yuzhang at ca dot ibm dot com>
- Date: Wed, 22 Aug 2001 11:15:22 -0700
Thank you all. Now I know where I got it wrong. I didn't know that
we need to use & to form a pointer to member.
IBM Canada Pacific Development Centre(PDC)
4611 Canada Way, Burnaby, B.C. Canada V5G 4X3
Phone: (604) 297-3108 Fax:(604)297-3020
<nathan@codesou To: Gabriel Dos Reis <firstname.lastname@example.org>
rcery.com> cc: Yu Zhang/CanWest/IBM@IBMCA, Phil Edwards
Sent by: <email@example.com>, firstname.lastname@example.org
email@example.com Subject: Re: c++/4047: assuming & on overloaded member functions
Gabriel Dos Reis wrote:
> "Yu Zhang/CanWest/IBM" <firstname.lastname@example.org> writes:
> | Hi Phil,
> | Thank you very much. It does work! But I'm confused,
> | which one is C++ standard?
> | server.use(T::foo); or server.use(&T::foo); ?
This is correct to pointer to (non-static) member function. In Yu's
case, T::foo is a static member, so the & is optional. Confusing, n'est
2.95 got this wrong when T::foo was overloaded.
For the record, refer to [5.3.1]/2 on how to form a pointer to member.
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
'But that's a lie.' - 'Yes it is. What's your point?'
email@example.com : http://www.cs.bris.ac.uk/~nathan/ :