I want to do something like
template void foo(const T& t) { IF bar(t) would compile bar(t); ELSE baz(t); }
If you're willing to limit yourself to Visual C++, you can use the __if_exists and __if_not_exists statements.
Handy in a pinch, but platform specific.