Loki's tricky templates

Kriang Lerdsuwanakij lerdsuwa@users.sourceforge.net
Mon Apr 23 09:05:00 GMT 2001


At 22:47 22/4/01 +0200, Paolo Carlini wrote:

>A courtesy: would you please mind having a quick look at (thereafter I 
>will move
>to other non-compile spots in Loki):
>
>     http://gcc.gnu.org/ml/gcc/2001-04/msg01019.html

Sure, the code is illegal.  According to the standard, in section 14.3.1 
paragraph 2:
     A local type, a type with no linkage, an unnamed type or a type compounded
     from any of these types shall not be used as a template-argument for a 
template
     type-parameter.
So template argument deduction for SetLongevity function call fails.

--Kriang



More information about the Gcc mailing list