Boost logo

Boost :

Subject: Re: [boost] variant2 never empty guarantees (was: Re: Outcome/expected/etc/etc/etc)
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2017-06-13 17:21:49

On Tue, Jun 13, 2017 at 1:07 PM, Peter Dimov via Boost
<boost_at_[hidden]> wrote:
> Gottlob Frege wrote:
>> This is basically why I'm satisfied with std::variant - move should never
>> throw. If it does, it was a tiny allocation, and you were screwed anyhow.
>> No one should have a move that does a large allocation.
>> So in my world, std::variant already has the never-empty (and never
>> valueless_by_exception) guarantee.
> Why are you then so insisting on the strong guarantee? It's only relevant
> when an operation throws.

I'm happy with std::variant. It makes some trade-offs, but I can live
with them.
But once someone tries to make a variant with less trade-offs, it
seems to me you should just go all the way - no trade-offs. I can and
will live with trade-offs, but who wouldn't like no trade-offs?

Basically, I was surprised that there was something between
std::variant and no-compromises-variant. It seems you want to explore
that area - _different_ trade-offs, or just _less_ trade-offs. But
you are approaching zero, I think you should just do zero. I could
easily be wrong.

Does that make sense?

Boost list run by bdawes at, gregod at, cpdaniel at, john at