This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Template Specialization Again



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