Boost logo

Boost :

Subject: Re: [boost] [variant2] documentation request
From: Peter Dimov (lists_at_[hidden])
Date: 2019-03-03 21:43:39


Niall Douglas wrote:

> This is why I would suggest variant2 provide elemental
> single_buffer_variant and double_buffer_variant, and let the end user
> choose which they want.

variant2 presently is single_buffer_variant except that instead of giving
you an error when that's not possible, it silently switches to
double_buffer_variant and soldiers on. (Which happens rarely.)

I agree that one can make a good argument for (a variation of)
double_buffer_variant, which prioritizes strong guarantee over sizeof. But
that's only needed when your contained types don't have noexcept move. In
this case, a not unreasonable course of action is to hold them by unique_ptr
in the variant instead.


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