dimanche 22 février 2015

How to partially specialize a template function for a specific template with int paramater

I can't find another question which seems to answer this.


I have a template defined as follows:



template <int N> classA;


//the body of class A is irrelevant for this problem really.


now I have a second class template:



template<typename T> classX
{
public:
static const unsigned number;
}


with a default implementation:



template<typename T> classX<T>::number = sizeof(T);


I however want to have a "specialization" for classX if used with classA. But for all/any template parameters N. How to I do that?


thank you for your reply :)


Aucun commentaire:

Enregistrer un commentaire