I have a template class, the only template parameter is typename.
template<typename T>
class Reader{
...
}
Now I want to specialize it for every integer type, something like:
template<typename T - integral>
class Reader{
//another code
}
How can I achieve this?
You can use a dummy
std::true_typeparameterIncidentally you will see this pattern used with
voidinstead oftrue_type, with the specializations often usingenable_ifand more complicated (and SFINAE involving) conditions.