So with SFINAE and c++11, it is possible to implement two different template functions based on whether one of the template parameters can be substituted.
For exampl
Using SFINAE, it's possible like this:
template class has_ostream_lshift { struct no {}; template static decltype(std::declval() << std::declval()) test(int); template static no test(...); public: enum { value = ! std::is_same(0))>::value}; };