Subject: Re: [boost] [outcome] Change semantics on UB from peer review agreed semantics?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2018-09-12 16:38:01
> could you point to some explanation, as to why hard UB was
> preferred over a compile time error in the first place?
It was a long time ago, and my memory may be faulty. But I think that
the general reasoning was that value-from-valueless is a logic error,
that means the program is incorrectly coded, that means hard UB. I
remember ancillary arguments about it being preferable that the UB
sanitiser fire on that logic error, that assert fires if NDEBUG is not
defined, and so on. So the hard UB only occurs in release builds, where
it invariably segfaults rather than being silent.
So, basically boost-dev, at that time, felt that *run time*
value-from-valueless on UDT error types ought to be treated as program
As I mentioned, most of Outcome's users - and there are a quite a few of
them - seem very keen on this hard UB. However these early adopters are
not the typical Boost user base. And I do buy in to Andrzej's point that
the current default will likely be surprising to the average C++
programmer who does not read the documentation, and to the developer who
changes the error type without changing the customisation points to match.
Also, Outcome underwent two reviews here. They were in depth. At the
time, I don't remember anybody finding issue with UDT error types
defaulting to hard UB. But maybe my memory is wrong.
And of course, boost-dev can always change their mind if a consensus
presents here in favour of that. I just didn't want to change Outcome in
such a non-reviewed way without getting approval here first.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk