Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-26 10:18:48


AMDG

Niels Dekker - mail address until 2008-12-31 wrote:
> Once the boost::swap utility would be used by other Boost libraries, end
> users might want to add a custom overload of swap for their classes to
> the boost namespace. Especially when users would have to deal with
> lacking ADL support of their compiler. Would it be okay for them to do
> so? Or are there some moral objections, or technical issues, regarding
> a user-provided overload within the boost namespace?
>

Adding overloads to namespace boost is not guaranteed to work either.

template<class T>
void foo(T& t1, T&t2) {
    boost::swap(t1, t2);
}

class X {};

namespace boost {
    void swap(X&, X&); // not found by foo.
}

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk