|
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]>
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. 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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk