Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-06-14 17:53:11


"Steven E. Harris" <seh_at_[hidden]> writes:

> Howard Hinnant <hinnant_at_[hidden]> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net