Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-08-09 14:13:24


On Friday 09 August 2002 02:29 pm, David Abrahams wrote:
> > the T does now, the T must be destructed before the U is constructed.
> > However, U's construction can throw so we need to save the value of T.
>
> Why? Isn't "empty" one of the allowed states for the variant object?

Not if we can help it. Back when we thought we had the strong guarantee, we
banished "empty" variants because they are a real pain to deal with. You
can't meaningfully visit them, you can't ensure completeness of decoding, and
basically a lot of the nice static-checking properties that come with
bounding your set of types disappear. Empty variants snuck back in when the
strong guarantee fell through. I'd still like to banish empty variants :)

My comment that we can't meet the basic guarantee was qualified by the
assumption that "empty" is not a valid state for a variant.

        Doug


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