When I\'m writing a function in a template class how can I find out what my T is?
e.g.
template ostream& operator << (os
Since C++11 we have std::is_same:
std::is_same
if (std::is_same::value) ...
It's implemented similar to the suggested trait TypeIsInt suggested in the other answers, but with two types to be compared.
TypeIsInt