This is the mail archive of the gcc@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: Is this template problem in ecgs?


Nicholas Lee <nlee011@math.auckland.ac.nz> writes:

> template<typename T>
> inline T& min(const T& x, const T& y) { return (x<y)? x:y; }

Not a template problem, actually.  It would also compile if you
replaced `template<typename T>' with `typedef int T;'.  It seems that
gcc disregards CV-qualification if the return value is a ?:
expression, but I haven't investigated the problem very much.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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