Boost logo

Boost :

Subject: Re: [boost] [variant2] Andrzej's review -- design
From: Peter Dimov (pdimov_at_[hidden])
Date: 2019-04-02 16:52:27


Andrzej Krzemienski wrote:

> It should be noted that variant2 DOES NOT PROVIDE A STRONG EXCEPTION
> SAFETY GUARANTEE.

Yes, variant2::variant is a never-valueless, basic guarantee variant.

There probably does exist a legitimate need for a strong guarantee variant,
which would have to make different design tradeoffs. It's certainly possible
to add one in the future, if there's demand.

(For instance, a "strong" variant wouldn't delegate to T::op= in its
assignment, from which it falls out that it would be able to store
non-assignable types and still be assignable itself. It would double-buffer
much more often though.)


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