Boost logo

Boost :

Subject: Re: [boost] [variant2] Andrzej's review -- design
From: degski (degski_at_[hidden])
Date: 2019-04-05 09:34:49


On Fri, 5 Apr 2019 at 09:07, Andrzej Krzemienski via Boost <
boost_at_[hidden]> wrote:

> I do not mind never-empty guarantee in principle. My problem is that
> providing it involves too much overhead. The costs outweigh the benefit. If
> there was a way to provide the never-empty guarantee for free, I would be a
> strong proponent of it.
>

I think you're right, catering for all kind of errors a bad/sloppy
programmer could make is just too expensive. On the other hand, there are
people who write code to fly things to the moon, drive autonomous cars etc
... stuff where it is just too expensive for things too fail.

I think there could be a satisfactory resolution of the issue(s) you raise
by naming boost::variant2 to something else, something like
boost::safe_variant, f.e.. This name also conveys the message that this one
could be more expensive in some cases [as most programmers would naturally
assume that that safety comes at a cost]. It also does away with the
problem that boost will have several variants, in addition to the one in
the standard and quite a number of other implementations floating around on
GitHub and elsewhere.

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