This is an open discussion about different ways to enable function overloading for parameters of only char, signed char or unsigned char type with the help of type traits in terms of C++11 template compiling.
Though satisfactory, a compound logic of std::enable_if and std::is_same type assertion (see PS) is not smart in that all matching types, particularly char in spite of signedness, are used in enumeration. Therefore I’m hoping someone can specify some other clause or compound logic that might facilitate type assertions better (maybe std::is_integral, std::is_arithmetic or std::is_signed?).
PS:
template <typename type>
void foo(std::enable_if<std::is_same<type, char>::value||std::is_same<type, signed char>::value||std::is_same<type, unsigned char>::value, type> x)
{
}
If you want a type trait like that, you will have to make one yourself: