problems with overload resolution and operator<< for templated types - part 2
Given the following code: #include <string> #include <type_traits> #include <sstream> #include <vector> #include <iostream> using namespace std; namespace has_insertion_operator_impl { typedef char no; typedef char yes[2]; struct any_t { template <typename T> any_t(T const&); }; no operator<<(ostream const&, any_t const&); yes& test(ostream&); no test(no); template <typename T> struct has_insertion_operator { static ostream& s; static T const& t; static bool const value = sizeof(test(s << t)) == sizeof(yes); }; } template <typename T> struct has_insertion_operator : has_insertion_operator_impl