In my template-ized function, I\'m trying to check the type T is of a specific type. How would I do that?
p/s I knew the template specification way but I don\'t want
If you are using C++11 or later, std::is_same does exactly what you want:
template constexpr bool IsFloat() { return std::is_same::value; } template void SomeMethodName() { if (IsFloat()) { ... } }
http://en.cppreference.com/w/cpp/types/is_same