123456789101112131415161718192021
template<class T> struct is_primitive { static const value = false; } template<> struct is_primitive<char> { static const value = true; } template<> struct is_primitive<int> { static const value = true; } template<> struct is_primitive<float> { static const value = true; } // etc...
template <typename T>