Is there any performance hit associated with using type traits?
More precisely, are following evaluations constant time? And can the compilet optimize out some of following cases?
Consider such code:
template<typename T> void Function()
{
if(std::is_pointer<T>::value == true)
DoSmth();
}
Function<int*>();
Will the compiler optimize such code to become effectively (in generated binary) something like that?
template<> void Function<int*>()
{
DoSmth();
}