====== 2014-09-24 - turtling ODR ====== in one of the project i use [[http://turtle.sourceforge.net|turtle mock]] framework. after having quite a bit of experience with [[http://code.google.com/p/googlemock|google mock]] i was a bit of a pain to get used to its compilation times -- 2x longer, for simple scenarios and gets worse with size. but this was the framework of choice in the project, so i have to live with it. today i found another interesting thing -- nice, silent way to break [[wp>one definition rule|ODR]]. i spent few hours trying to figure out why my type, which has //operator< namespace detail3 { template< typename S, typename T > S& operator<<( S &s, const T& ) // (2) { return s << '?'; } } template< typename T > stream& operator<<( stream& s, const T& t ) // (1) { using namespace detail3; *s.s_ << t; return s; } //T// is your parameter type. at first glance it looks like a very clever thing to do: if there is an //operator<