On Sat, Mar 2, 2019 at 1:20 PM Peter Dimov via Boost
Niall Douglas wrote:
It so happens that the strong guarantee is unachievable with variant (without too much double buffering.) You can either have basic, or noexcept.
You surprise me, given this is a design capable of double buffering.
I guess you haven't written out anywhere how and when the double buffering comes into play.
That is actually the one thing I have written, twice, once in the README and one in the Overview section of the documentation. :-)
"To avoid going into a valueless-by-exception state, this implementation falls back to using double storage unless
* one of the alternatives is the type monostate, * one of the alternatives has a nonthrowing default constructor, or * all the contained types are nothrow move constructible."
So, yes, variant will be double-buffered, but variant
and variant won't be.
For variant