This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with templates used in a class member.
- To: ramon at jl1 dot quim dot ucm dot es (Ram'on Garc'ia), egcs at cygnus dot com
- Subject: Re: Problem with templates used in a class member.
- From: Jason Merrill <jason at cygnus dot com>
- Date: 08 Sep 1998 14:03:33 -0700
- References: <199809040154.DAA11631@jolan.ppro> <Pine.LNX.3.96.980904184640.17423B-100000.cygnus.egcs@jl1.quim.ucm.es>
>>>>> Ram'on Garc'ia <ramon@jl1.quim.ucm.es> writes:
> On Fri, 4 Sep 1998, Carlo Wood wrote:
>> (You forgot a '&' in front of fn)
>> I *think* that this is not a limitation of egcs...
>> Consider:
>>
>> template <class P, void (P::*member)()>
>> class x { };
>>
>> class user {
>> public:
>> user() {}
>> void fn() {}
>> x<user, &user::fn> a;
>> };
> I am not a C++ guru; however, it is usual in both C and C++ that you can
> leave out the & sign for pointers to functions.
Yes, but not for pointers to member functions. This is a deliberate
difference.
> I do not have a copy of the C++ standard; I can read the 1996 working
> paper. Therefore, I usually relay on EDG based compilers, since this
> frontend was written by members of the C++ ANSI/ISO commitee.
Well, so is g++. So are all the other C++ compilers. EDG is definitely
one of the better compilers, tho.
Jason