Boost logo

Boost :

Subject: Re: [boost] [variant] Please vote for behavior (Was: Basic rvalueand C++11 features seupport)
From: Peter Dimov (lists_at_[hidden])
Date: 2013-01-21 12:47:43


Louis Dionne wrote:
> My vote goes to II.
>
> - Using moved-from objects should rarely happen, if ever.
> - It is not even a breaking change since move from variants was not
> supported in the past.

That's not quite true. If a type doesn't have a move constructor, move is
supported and same as copy.

> Moreover, I am explicitly against proposition III:
>
> - The state of the moved-from variant is not explicitly set by the
> programmer. I tend to prefer explicit to implicit.
> - The type held in the moved-from variant depends on the types in the
> variant, which could make it harder to use variants in generic code.

I fail to grasp the logic that simultaneously holds that

> - Using moved-from objects should rarely happen, if ever.

and then proceeds to argue that moved-from objects should not be left in
such-and-such valid state, but must be left in an invalid state instead.


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