Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-02-19 05:38:11


From: "Hamish Mackenzie" <boost_at_[hidden]>
> I thought this was solved by Koenig lookup?
>
> using std::swap;
> swap( x, y );
>
> Then Koenig lookup will find swap if it is in the namespace that x and y
> are in will it not?

http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1296.htm

In short, yes it will. This is error-prone, though (experts have been known
to get that wrong) and it doesn't solve the problem within the standard
library, i.e. std::sort using std::swap (without additional guarantees.)


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