You could use typeid
:
if (typeid(T) == typeid(int))
Or you could use the std::is_same
type trait:
if (std::is_same<T, int>::value)
You could use typeid
:
if (typeid(T) == typeid(int))
Or you could use the std::is_same
type trait:
if (std::is_same<T, int>::value)