Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2007-08-11 08:18:11


on Sat Aug 11 2007, "Joseph Gauterin" <joseph.gauterin-AT-googlemail.com> wrote:

> Would anyone be interested in me adding an koenig lookup swap function
> to boost? (I would say it belongs in boost.utility).
>
> It would be a swap function that uses Koenig lookup to find the 'best'
> swap funciton, falling back on std::swap like this:
>
> template <class T>
> void koenig_swap(T& left, T& right)
> {
> using std::swap;
> swap(left,right);
> }
>
> Several boost libraries (multi array, compressed pair, graph,
> optional, spirit) already use this technique, each time explicitly
> with 'using std::swap' instead of abstracting it out.

The appropriate name for that function is boost::swap
:-)

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
The Astoria Seminar ==> http://www.astoriaseminar.com

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