In the description of some std template function I saw something like:
if the template parameter is of integral type, the behavior is such and such.
One possibility:
#include
#include
struct trivial
{
int val;
};
int main()
{
std::cout << "is_integral == " << std::boolalpha
<< std::is_integral::value << std::endl;
std::cout << "is_integral == " << std::boolalpha
<< std::is_integral::value << std::endl;
std::cout << "is_integral == " << std::boolalpha
<< std::is_integral::value << std::endl;
return (0);
}
So you then use std::is_integral<> to determine the action.