This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Template bug?


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}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]