This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Template Specialization Again
- To: Hirofumi SHINKE <shinke at newhouse dot rim dot or dot jp>
- Subject: Re: Template Specialization Again
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 16 Feb 1999 23:42:53 -0200
- Cc: egcs at egcs dot cygnus dot com
- References: <19990215010319P.shinke@newhouse.rim.or.jp>
On Feb 14, 1999, Hirofumi SHINKE <shinke@newhouse.rim.or.jp> wrote:
> template <class T> void f(T x){
[snip]
> template <class T> void f<T *>(T x){ // error at this line!
> Dose it mean that egcs dosen't support this type of specialization yet?
There's no such thing as partial specialization of function templates.
C++ only supports partial specialization of class templates, and
explicit (full) specialization of function and class templates. Try:
template <class T> void f(T* x) {
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil