Boost logo

Boost :

Subject: Re: [boost] variant2 never empty guarantees (was: Re: Outcome/expected/etc/etc/etc)
From: Peter Dimov (lists_at_[hidden])
Date: 2017-06-14 13:27:43


Andrzej Krzemienski wrote:

> So, you mean -- unless I am using the special "valueless" type -- all
> assignments/emplacements/swaps are strong (possibly at the expense of
> double buffering in some cases)? That is, there is no "get C upon
> unsuccessful assignment of A to B"?

The only situation in which you get a C is when C is the special `valueless`
type, yes. This does not mean that all assignments are strong. In

    variant<vector<string>> v1, v2;

    v1 = v2;

the assignment is basic, because that's the guarantee
vector<string>::operator= gives.


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