
2 Mar
2013
2 Mar
'13
6:09 p.m.
Can you give an example of how it's usage would be?
Sort an interesting question. I'm imagining something like:
template<class T> int f(T const & t){ if(std::is_lteral_type<T>) return t; else return g(t); // do some sort of conversion }
in order to skip instantiation/invokation of g when it isn't necessary in this example.
That wouldn't work - just because a type is a literal type doesn't mean that it's convertible to int. In that particular case wouldn't is_convertible do? John.