Boost logo

Boost :

Subject: Re: [boost] [variant] Heads-up!
From: Lee Clagett (forum_at_[hidden])
Date: 2019-04-29 19:16:17


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, April 29, 2019 7:08 PM, Antony Polukhin via Boost <boost_at_[hidden]> wrote:

> пн, 29 апр. 2019 г. в 21:52, Steven Watanabe via Boost boost_at_[hidden]:
>
> > AMDG
> > On 4/29/19 11:30 AM, Antony Polukhin via Boost wrote:
> >
> > > I've merged a very cool optimization by Nikita Kniazev into the master
> > > branch. From now on boost::variant does pointer stealing for recursive
> > > variants.
> > > This significantly improves the performance of the variants move constructors.
> > > However if you use a variant variable after the std::move for anything
> > > except destruction and assignment then you're getting an UB. Beware!
> >
> > We've had this discussion before:
> > https://lists.boost.org/Archives/boost/2013/02/200744.php
>
> This discussion was considered. Please see the two comments from
> Nikita Kniazev https://github.com/boostorg/variant/pull/59#issuecomment-459573177
>

Those arguments miss the entire point - boost::variant had a long
standing never-empty guarantee. So the optimization was not in a valid
state according to boost::variants own specifications.

Lee


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