Templates and generic programming
T.48
If your compiler does not support concepts, fake them with `enable_if`
Reason
Because that's the best we can do without direct concept support. enable_if can be used to conditionally define functions and to select among a set of functions.
Example
template<typename T>
enable_if_t<is_integral_v<T>>
f(T v)
{
// ...
}
// Equivalent to:
template<Integral T>
void f(T v)
{
// ...
}
Note
Beware of complementary constraints. Faking concept overloading using enable_if sometimes forces us to use that error-prone design technique.
Enforcement
???