I am looking for a way to identify primitives types in a template class definition.
I mean, having this class :
template
class A{
void
It cannot be done exactly the way you asked. Here is how it can be done :
template
class A{
void doWork(){
bool isPrimitive = boost::is_fundamental::value;
if(isPrimitive)
doSomething();
else
doSomethingElse();
}
private:
T *t;
};
You may get a warning if you put the value of isPrimitive directly inside the if statement. This is why i introduced a temporary variable.