Boost logo

Boost :

Subject: Re: [boost] [variant2] Andrzej's review
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2019-04-13 05:16:08

On Fri, Apr 12, 2019 at 9:40 PM degski via Boost <boost_at_[hidden]>
> On Sat, 13 Apr 2019 at 00:47, Vinnie Falco via Boost <
> 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
> 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. 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.

Boost list run by bdawes at, gregod at, cpdaniel at, john at