superfluous constructor ?

Jonathan Wakely jwakely.gcc@gmail.com
Sun Feb 26 12:29:00 GMT 2012


On 26 February 2012 03:21, Serge Pavlovsky wrote:
> hi
> in <functional>
>      function&
>      operator=(function&& __x)
>      {
> function(std::move(__x)).swap(*this);
> return *this;
>      }
> why not just __x.swap(*this); ?
>

That would not destroy the current contents of *this immediately.



More information about the Libstdc++ mailing list