Subject: Re: [boost] [variant2] Need rationale for never-empty guarantee
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2019-03-01 18:02:24
On 3/1/19 9:41 AM, Niall Douglas via Boost wrote:
> I can see the logic, but it is wrong in my opinion. The variant should
> be put back into the state it was in beforehand, in my opinion.
> (Personally speaking, I find the double buffering a step too far. I
> remember debating this with Anthony Williams a few years ago at ACCU. I
> think that if double buffering is necessary, then you weaken your
> guarantees to basic, and you provide a constexpr bool for static
> asserting when the guarantees are basic or strong.
I almost agree with this. double buffering is definitely
the right choice when it is needed to get the basic guarantee.
I don't think it's worthwhile if all it gives you is
upgrading the basic guarantee to the strong guarantee.
I support the strong guarantee as long as it can be
achieved with some combination of moves.
> In any case, I find
> the valueless by exception state to be an abomination,
+1. I don't really care whether variant has an
empty state or not, but if it exists at all it
needs to be a first class citizen. As such I
was always quite happy with boost::blank or monostate.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk