Let\'s say, I have six types, and they each belong in a conceptual category.
Here is a diagram that shows this:
I think using tag despatch would be easier than SFINAE.
template
struct Category;
template<>
struct Category : std::integral_constant {};
template<>
struct Category : std::integral_constant {};
template<>
struct Category : std::integral_constant {};
template<>
struct Category : std::integral_constant {};
template<>
struct Category : std::integral_constant {};
template<>
struct Category : std::integral_constant {};
template
void foo(std::integral_constant, T x)
{
// Category 1 types.
}
template
void foo(std::integral_constant, T x)
{
// Category 2 types.
}
template
void foo(T x)
{
foo(Category(), x);
}