Boost logo

Boost :

Subject: Re: [boost] variant2 never empty guarantees (was: Re: Outcome/expected/etc/etc/etc)
From: David Sankel (camior_at_[hidden])
Date: 2017-06-17 04:58:31


On Jun 13, 2017 1:21 PM, "Gottlob Frege via Boost" <boost_at_[hidden]>
wrote:

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.

+1


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