Template bug?

Alexandre Oliva oliva@dcc.unicamp.br
Mon May 31 21:06:00 GMT 1999

On May 19, 1999, mitchell@codesourcery.com wrote:

>>>>>> "Manuel" == Manuel Menezes de Sequeira <mms@torga.iscte.pt> writes:
Manuel> template <class R, class T>
Manuel> R f(T i) {

Manuel> template <class R, class T>
Manuel> R f(T* i) {

> The question is which of these is more specialized.  The answer is
> neither; trying to deduce the arguments of either from the other does
> not bind `R', since deduction does not look at the return-type.  So, I
> believe EGCS to be correct.

Indeed.  It seems to me like one of those corner cases that nobody
considered (or at least nobody considered worth specifying).  IMO, it
would be a good idea if the standard could be ammended so that, in
case of explicit specification of some of the template arguments, they
need not be considered when evaluating partial ordering of function
templates.  But maybe this just opens a can of worms...

Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
*** E-mail about software projects will be forwarded to mailing lists

More information about the Gcc-bugs mailing list