I would like to specialize template by group of types and also by extra definition for some specific simple types. Is it in C++11 and boost 1.60 possible? Following pseudocode illustrates my intention:
template <typename T> // Universal definition
struct convert
{ ... }
template <> /* Definition for integral types like defined by std::type_traits */
struct convert<integral_types>
{ ... }
template <> /* Definition for floating point types like defined by type_traits */
struct convert<floating_types>
{ ... }
template <> /* Exception from integral types - specific definition */
struct convert<char>
{ ... }
I think this could be solved by tag dispatcher, but I'm not sure if it's best solution. Another option is enable_if, combined with is_integral (and similar groups) , but simple char type is problem...