Boost logo

Boost :

Subject: Re: [boost] [variant] Heads-up!
From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2019-04-29 20:06:07


On Mon, Apr 29, 2019 at 12:30 PM Antony Polukhin via Boost <
boost_at_[hidden]> wrote:

> Hi,
>
> 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!
>

The entire reason for using boost::variant is to get the never-empty
guarantee. If I want something more efficient, I can use std::variant,
boost::variant2, or even roll my own.

This change removes the only compelling feature that recommends the use of
boost::variant.

I agree that this is a wholly unacceptable change.

Zach


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