Using typedefs as template arguments.

Alexandre Oliva oliva@dcc.unicamp.br
Thu Jul 9 20:45:00 GMT 1998


ak  <ak@muc.de> writes:

> template <class T, size_t sz>
> inline int size(T (&array)[sz]) { return sz; }

> talen.cc: In function `int main()':
> talen.cc:12: no matching function for call to `size (char[100])'

> Is this a bug/unimplemented feature

Yes, it's a known problem that breaks template argument matching for
typedefs.

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




More information about the Gcc-bugs mailing list