Boost logo

Boost :

Subject: Re: [boost] [review][variant2] Variant2 Review Starts April 1
From: dariomt_at_[hidden]
Date: 2019-03-26 09:54:27


>
> dariomt--- wrote:
> > > The class boost::variant2::variant<T...> is an almost conforming
> > > implementation of std::variant with the following differences:
> >
> >
> > I see the useful comparison to std::variant in the doc, however I'm
> using
> > boost::variant extensively in my code.
> >
> > It would be very useful to have also a short comparison to
> boost::variant
> > in the doc, as I would expect many more current users of the venerable
> > boost::variant than of its much younger cousin std::variant.
>
> The main difference is that Variant2 is a pin-compatible replacement for
> std::variant, whereas Boost.Variant isn't (at least for now). So it's
> easier
> to switch from std::variant to Variant2 and back (depending f.ex. on
> whether
> std::variant is available.)
>
> The second most important difference would probably be the fact that
> Boost.Variant may do heap allocations.
>

This is useful info, thanks!
I understand that the main objective is to offer a "better" std::variant,
but as a user of Boost.Variant wondering "Should I consider migrating to
Boost.Variant2?", I would expect a section in the doc addressing this
question.


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