Simple template bug egcs1.1.1

Alexandre Oliva oliva@dcc.unicamp.br
Mon Jan 25 08:01:00 GMT 1999


On Jan 25, 1999, <nbecker@fred.net> wrote:

> template<class A, class B>
> A sqr(A x) { return x * x; }

> There is a simple mistake, it should say
> template<class A>

> but logically if B is not used it should be ignored, I think.

Nope.  If it cannot be deduced, it must be explicitly specified.  egcs 
is correct.

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




More information about the Gcc-bugs mailing list