2 Mar
2019
2 Mar
'19
12:02 a.m.
On Fri, Mar 1, 2019 at 2:18 PM Andrzej Krzemienski via Boost < boost@lists.boost.org> 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".