Boost logo

Boost Users :

Subject: Re: [Boost-users] [utility] swap
From: Neil Groves (neil_at_[hidden])
Date: 2010-03-05 08:37:28


On Fri, Mar 5, 2010 at 1:29 PM, Robert Jones <robertgbjones_at_[hidden]>wrote:

> I'm sure I'm being a bit dense here, but apart from handling native arrays
> what does boost::swap give
> you that std::swap doesn't?
>
>
Extensibility. You call the qualified boost::swap but you can have
implementations of swap in a namespace along with the swapee (is that a
word?!). This facility is hugely useful when creating your own types and
libraries for which you desire swap support. Users that call boost::swap
will automatically leverage your customized swap behaviour.

> Thanks,
>
> - Rob.
>
>
Regards,
Neil Groves



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