Boost logo

Boost :

Subject: Re: [boost] [variant2] documentation request
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2019-03-03 21:15:47


niedz., 3 mar 2019 o 21:27 Niall Douglas via Boost <boost_at_[hidden]>
napisał(a):

> > My point is, users who will read the introductory part of the
> documentation
> > will get an incorrect impression that variant2 already offers a strong
> > exception safety guarantee. The docs never state that, but when you read
> > the clever things what this library does, some users will think, "surely
> > this must be to achieve the strong guarantee". A not that states
> explicitly
> > that this is not a strong guarantee would help avoid this confusion.
>
> 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.
>

I would take this idea further (or rather in a different direction), and
say that you never need double_buffer_variant for automatic objects used
locally. For global objects (or global-like) you need double buffering not
only for variants, but probably for every type that does not offer strong
guarantee on its operations, so what you need is a generic double-buffer
wrapper.

Regards,
Andrzej


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