Boost logo

Boost :

Subject: Re: [boost] [variant] Please vote for behavior
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2013-01-25 17:20:08

2013/1/25 Gottlob Frege <gottlobfrege_at_[hidden]>

> On Fri, Jan 25, 2013 at 4:25 PM, Krzysztof Czainski <1czajnik_at_[hidden]
> >wrote:
> > So to me the question is: should move introduce an "uninitialized" state
> > for types that don't have one in the first place. Int has an
> uninitialized
> > state. Iterators in std algorithms are allowed to have such a state too.
> > And now we have moved-from objects - should they be allowed an additional
> > "uninitialized" state?
> > I answer yes, because moved-from objects must not be used for anything
> > other than destruction or assignment-to.
> >
> But I don't think this is the question - or it was, but no longer is -
> because I think the standard already asked and answered the question (and
> it was hotly debated, but answered) - the answer was that moved from
> objects should be in valid but unknown states. ie not UB. not
> uninitialized.

Oh, thanks for clarifying this. I thought the standard said, that moved
from objects should be in a state valid only for destruction/assignment to.
If I was wrong, and it says the moved from objects must also be usable in
other ways (i.e. readable), then you just convinced me here ;-) And in this
case, I am against adding an empty state to variant recursive wrapper.

We might wish it different, but it isn't.


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