Subject: Re: [boost] [variant] Heads-up!
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2019-04-29 20:54:00
On Mon, Apr 29, 2019 at 4:50 PM Steven Watanabe <watanabesj_at_[hidden]> wrote:
> On 4/29/19 2:28 PM, Matt Calabrese wrote:
> > On Mon, Apr 29, 2019 at 4:23 PM Matt Calabrese <rivorus_at_[hidden]> wrote:
> >> <snip>
> >> Stressing that, as Steven points out, this wouldn't violate the
> >> never-empty guarantee *if* after stealing you were able to
> >> default-construct something on the right-hand side and update the
> >> discriminator accordingly
> > Continuing on this thought, you don't necessarily have to
> > default-construct on the right-hand side to satisfy the never-empty
> > guarantee here. If the left-hand side also happens to currently
> > contain a recursive_wrapper, or something that is
> > nothrow-move-constructible, it can be moved into or swapped with rhs.
> That's true, but it doesn't help much, because
> it only applies to assignment, not construction.
True. And noexcept-ness, in practice, often ends up more being more
frequently needed for construction than for assignment anyway. Or at
least that's been my personal experience, anyway.
-- -Matt Calabrese
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk