You could use typeid:
typeid
if (typeid(T) == typeid(int))
Or you could use the std::is_same type trait:
std::is_same
if (std::is_same<T, int>::value)
1.4m articles
1.4m replys
5 comments
57.0k users