Boost logo

Boost :

Subject: Re: [boost] [variant2] Andrzej's review -- documentation
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2019-04-10 04:37:02


niedz., 7 kwi 2019 o 05:33 Peter Dimov via Boost <boost_at_[hidden]>
napisał(a):

> 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);
> > ```
> >
> > This works fine with std::variant, but fails to compile with
> > variant2::variant, because the latter requires all the alternative
> types,
> > at least in one implementaiton of the never-empty trick, to be
> > move-constructible. But this requirement is never listed in either
> global
> > requirements for alternative types stored in variant, or in the
> > specification of functions `emplace()`.
>
> 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? Go double-buffer in this case?

Regards,
&rzej;


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