I am looking for a way to identify primitives types in a template class definition.
I mean, having this class :
template
class A{
void
Assuming by 'Primitive Type' you mean the built in types you can do a series of template specializations. Your code would become:
template
struct A{
void doWork();
private:
T *t;
};
template<> void A::doWork()
{
doSomething();
}
template<> void A::doWork()
{
doSomething();
}
// etc. for whatever types you like
template void A::doWork()
{
doSomethingElse();
}