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: Using typedefs as template arguments.


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



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