Boost logo

Boost :

Subject: Re: [boost] [variant] Please vote for behavior (Was: Basic rvalue and C++11 features seupport)
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-01-21 09:29:53

On Mon, Jan 21, 2013 at 5:39 PM, Antony Polukhin <antoshkka_at_[hidden]> wrote:


> II: Set operand.p_ to NULL, add BOOST_ASSERT in get operations
> + good performance
> + provides noexcept guarantee for move constructor
> + optimization will be used even if varinat has no type with trivial
> default constructor
> + easy to implement
> - triggers an assert when user tries to reuse moved object
> - adds an empty state to the recursive_wrapper

I'd prefer this option. IMHO, one of the major points of move
semantics is optimization and moved-from objects are as good as dead
anyway; I wouldn't even try to revive a moved-from object with
assignment. But this is a breaking change (is it?), so it should have
a prominent note in release notes.

Boost list run by bdawes at, gregod at, cpdaniel at, john at