How can I specify what is required to be a valid template argument? What I mean is let’s for example take something like this:
template<class T>
void f(const T& obj)
{
//do something with obj
}
but I would like T to be only integer type so I would accept char, int, short unsigned etc but nothing else. Is there (I’m sure there is) a way to detect it what is provided as a template arg?
Thank you.
Have a look at concept checking (http://www.boost.org/doc/libs/1_43_0/libs/concept_check/concept_check.htm).