This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static template initialization pb
- To: <neal at ctd dot comsat dot com>
- Subject: Re: static template initialization pb
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 30 Nov 1997 20:21:18 -0200
- Cc: egcs at cygnus dot com
- References: <E0xcCHh-00003T-00@neal.fred.net>
writes:
> I believe the current standard should allow initialization in the
> declaration, so this should work:
But this only works for integral types, and definition outside the
class body is still mandatory unless you define a constant. In this
case, the definition must not contain an initialization:
template<class T> T X<T>::c; // = 0;
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil