Boost logo

Boost :

Subject: Re: [boost] [variant2] Need rationale for never-empty guarantee
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2019-03-02 00:02:46


On Fri, Mar 1, 2019 at 2:18 PM Andrzej Krzemienski via Boost <
boost_at_[hidden]> wrote:
> variant2 also only provides *basic* exception safety guarantee: you can be
> assigning a variant containing type B to a variant containing type A and
> end up with variant containing type C. Here's an example:
> https://wandbox.org/permlink/AObFiUKgeXIEiXQa
>
> My point is, you can only observe the valueless state in variant if you
> work with objects that threw from a basic-guarantee operation. But if you
> do this, you already have mess in your program regardless if you are using
> variants or not.

This is true only if we define "mess" to mean "an unspecified but valid
state".


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