I want to do something like
template void foo(const T& t) { IF bar(t) would compile bar(t); ELSE baz(t); }
//default ////////////////////////////////////////// template void foo(const T& t){ baz(t); } //specializations ////////////////////////////////////////// template <> void foo(const specialization_1& t){ bar(t); } .... template <> void foo(const specialization_n& t){ bar(t); }