Boost logo

Boost :

Subject: Re: [boost] [variant2] Andrzej's review
From: degski (degski_at_[hidden])
Date: 2019-04-13 06:06:18


On Sat, 13 Apr 2019 at 05:16, Emil Dotchevski via Boost <
boost_at_[hidden]> wrote:

> On Fri, Apr 12, 2019 at 9:40 PM degski via Boost <boost_at_[hidden]>
> wrote:
> >
> > On Sat, 13 Apr 2019 at 00:47, Vinnie Falco via Boost <
> boost_at_[hidden]>
> > wrote:
> >
> > > If I want/need a variant that offers the never-empty basic guarantee
> > > then Boost should not provide it?
> > >
> >
> > Andrzej argues (in the other post) that you *shouldn't want* it, becoz it
> > masks UB [result of programmer error] and will now cause havoc elsewhere
> in
> > the program.
>
> The basic guarantee prevents UB, doesn't mask it.
>
> Perhaps you mean to say "masks bugs", or at least that's how I read
> Andrzej's opinion.

Yes, 'masks bugs', standing corrected.

This may be so, but I fail to see why the argument
> against the basic guarantee in variant2 assignment does not apply in
> general. It would help me (and perhaps others) understand this argument if
> someone explains why is the basic guarantee appropriate in, say, the
> std::vector<T>::op=, but not in variant.
>

My answer is [not that you asked for it], I don't know. I can absolutely
see the value of a strong guarantee, but not of the basic guarantee.

degski

-- 
*Microsoft, please kill Paint3D*

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