"Steven E. Harris" <seh@panix.com> writes:
Howard Hinnant <hinnant@twcny.rr.com> writes:
It would be nice if when pair<MyNamespace::MyType, int> was given to operator<< both namespace std and namespace MyNamespace were searched for viable overloads.
Thank you for the explanation.
Perhaps this is similar to the "where do I customize swap()?" question, but one could argue that this overload should live in the std namespace, where the least specialized template function was declared. After all, it's std::operator<<() that we're overloading, not MyNamespace::operator<<(). We're trying to introduce special behavior for a particular argument type, not change the basic protocol of the template function.
Yes, one might argue that. http://boost-consulting.com/writing/n1691.html -- Dave Abrahams Boost Consulting www.boost-consulting.com