This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: c++/4047: assuming & on overloaded member functions
- To: Phil Edwards <pedwards at disaster dot jaj dot com>
- Subject: Re: c++/4047: assuming & on overloaded member functions
- From: "Yu Zhang/CanWest/IBM" <yuzhang at ca dot ibm dot com>
- Date: Tue, 21 Aug 2001 09:53:13 -0700
- Cc: gcc at gcc dot gnu dot org
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); ?
The first compiles on AIX native c/c++ compiler xlc, as well
as gcc3.0. And I guess it is correct in grammar. Since T::foo is
a pointer to function?
Maybe in gcc2.95.x, T::foo is not a pointer to member function?
------------
Yu Zhang
02/0CW1/4611/BURN
IBM Canada Pacific Development Centre(PDC)
4611 Canada Way, Burnaby, B.C. Canada V5G 4X3
Phone: (604) 297-3108 Fax:(604)297-3020
E-mail: yuzhang@ca.ibm.com
Phil Edwards
<pedwards@disaste To: Yu Zhang/CanWest/IBM@IBMCA
r.jaj.com> cc: gcc@gcc.gnu.org
Subject: Re: c++/4047: assuming & on overloaded member functions
08/20/2001 12:40
PM
Please respond to
Phil Edwards
On Fri, Aug 17, 2001 at 02:31:38PM -0700, Yu Zhang/CanWest/IBM wrote:
> I've just submitted a bug report c++/4047. I'm wondering if anybody else
> has encountered the same problem before. Is there any quick fix for
2.95.x?
[...]
> >Description:
> when we use an overloaded static member function as
> another function's input argument, g++ report "assuming
> & on overloaded member functions".
[...]
> void call()
> {
> server.use(T::foo);
> };
What's the problem with just writing
server.use(&T::foo);
instead? This is specifically allowed by the C++ standard, and would work
under both versions.
Phil
--
Would I had phrases that are not known, utterances that are strange, in
new language that has not been used, free from repetition, not an utterance
which has grown stale, which men of old have spoken.
- anonymous Egyptian scribe, c.1700 BC