partitial template specialization for multi-template-class methodes

Hi template wizzards,

I have a class (ClassName) with multiple template parameters (T_Type, T_Precision). I need a template specialization for a method (void method()). The specialization should only apply to one template parameter (T_Precision).

- Is this possible with vc7 / vc8
- If so, how does it work

I tried it the following way:


template<typename T_Type, typename T_Precision>
class ClassName
{
  void method();
};

template<typename T_Type>
void
ClassName<T_Type, double>::
method()
{
 //do something
}

template<typename T_Type>
void
ClassName<T_Type, float>::
method()
{
 //do something
}

but only got the following errors with vc7

C3860: template argument list following class template name must list parameters in the order used in template parameter list
C2976: ClassName' : too few template arguments...

It would be great if someone could help.

Thanks verry much,

ichNET



Answer this question

partitial template specialization for multi-template-class methodes