This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Suspected template parsing bug.



On Feb 28, 1999, Paul Derbyshire <pderbysh@usa.net> wrote:

> At 10:15 PM 2/27/99 -0500, you wrote:
>> If X::rebind is fashioned in the same vein as std::allocator<T>::rebind<U>,
>> then you must qualify it with the 'template' keyword.
>> 
>> ... typename X::template rebind< ....

> 1. Not according to Stroustrup 3rd Ed, aka 'source'.

Sorry, Stroustrup is ``wrong''.  The C++ Standard requires both
typename and template in this case.

> 2. The code in question compiles once I fix the real error, which is
>    that "math_traits" wasn't in scope.

Even with -ansi -pedantic?  It should reject the code in this case.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil