Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::system::error_code::swap proposal
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2009-04-14 10:15:33


I assume you can't implement it more effecient as using a default std::swap,
which does it with any copyable object, e.g.

namespace std
{
template<class T>
void swap(T& lhs, T& rhs)
{
    T tmp=lhs;
    lhs = rhs, rhs = tmp;
}
}

specializing/oveloading swap makes sence only if you can exchange pointers
instead of copying large content (like std::vector or any other collection).
With error_code it is not the case.

Greetings,
Ovanes

On Tue, Apr 14, 2009 at 1:22 PM, Marat Abrarov <abrarov_at_[hidden]> wrote:

> Why boost::system::error_code doesn't have swap method (or overloaded swap
> friend function)?
> boost::system::error_code is copyable so it must have such "swap".
> Any opinions?
>
> Best regards,
> Marat Abrarov.
>



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