Can anyone help me with this code. I'm trying to specialise a method. At the moment it doesn't work with one specialisation (1) but I'd like to ultimately have lots of specialisations (2, 3, 4, 5 etc)
class X
{
public:
// declaration
template< int FLD >
void set_native( char *ptr, unsigned int length );
// specialisations
template<> void set_native< 1 >( char *ptr, unsigned int length )
{
}
};
The error messages I'm getting are..
x.cpp:13: error: explicit specialization in non-namespace scope 'class X' x.cpp:13: error: template-id 'set_native<1>' for 'void set_native(char*, unsigned int)' does not match any template declaration x.cpp:13: error: invalid function declaration