Boost logo

Boost :

Subject: Re: [boost] [variant2] Andrzej's review -- documentation
From: Peter Dimov (pdimov_at_[hidden])
Date: 2019-04-10 13:03:10


Andrzej Krzemienski wrote:
...
> > > Consider the following example:
> > >
> > > ```
> > > struct X {};
> > >
> > > struct Guard {
> > > explicit Guard(int) {}
> > > Guard(Guard&&) = delete;
> > > };
> > >
> > > variant<X, Guard> v {};
> > > v.emplace<Guard>(1);
> > > ```
...
> > The documentation is correct, the implementation is wrong here; this
> > should work and the fact that it doesn't is a bug. Thanks.
>
>
> Might I ask how you plan to fix this bug?

It's fixed in
https://github.com/pdimov/variant2/commit/9f7e525984ac87ccb90799c9bb2283946db2e123.

> Go double-buffer in this case?

There's no reason to double-buffer here, because X is nothrow default
constructible, so it can be used as a fallback type.


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