This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
problem specializing static member function
- To: egcs-bugs at cygnus dot com
- Subject: problem specializing static member function
- From: scott snyder <snyder at d0sgif dot fnal dot gov>
- Date: Fri, 23 Jan 1998 14:55:25 -0600 (CST)
hi -
This is for egcs, taken from the cvs repository on Jan. 23,
on a mips-sgi-irix5.3 platform.
g++ gives an error for the appended code:
x.cc:13: `d0om_make<>' does not match any template declaration.
x.cc:13: confused by earlier errors, bailing out
It compiles without error if the `static' keyword in T2 is removed.
As far as i can tell, this code is ok by the standard. It allows
explicit specialization of member functions of template classes,
and doesn't say anything special about static member functions...
thanks,
sss
template <class T>
class T2
{
public:
static T2* d0om_make ();
};
template<>
T2<int>* T2<int>::d0om_make ()
{
return new T2<int> ();
}