This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Specialization in templates
- To: un9i at rz dot uni-karlsruhe dot de (Matthias Seeger)
- Subject: Re: Specialization in templates
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 29 Oct 1998 20:10:07 -200
- Cc: egcs at cygnus dot com
- References: <E0zYHAk-0002lz-00@rzstud1.rz.uni-karlsruhe.de>
Matthias Seeger <un9i@rz.uni-karlsruhe.de> writes:
> template<class T> class A<T*> { };
> my EGCS compiler stops with "parse error before <'"
And it is correct.
> Does this mean that templete specialization (Stroustrup, 3rd ed.,
> p.341) is not yet supported by EGCS?
Nope; specialization is supported, but, in order to specialize a
template, you must first declare it.
Before the specialization, insert the following line and you're done:
template<class T> class A;
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil