Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2020-09-17 21:34:15


On Thu, Sep 17, 2020 at 2:03 PM Peter Dimov via Boost
<boost_at_[hidden]> wrote:
> T& operator=( T const& rhs )
> {
> T(rhs).swap(*this); return *this;
> }

The memory_resource associated with a value can never change after
construction, so the above would have to be written as:

    T& operator=( T const& rhs )
    {
        T( rhs, this->storage() ).swap( *this );
        return *this;
    }

and

    T& operator=( T const& rhs )
    {
        T( std::move(rhs), this->storage() ).swap( *this );
        return *this;
    }

Which I think is ok...

Thanks


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