14 Jun
2006
14 Jun
'06
8:58 p.m.
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. -- Steven E. Harris