Boost logo

Boost :

Subject: Re: [boost] [outcome] Change semantics on UB from peer review agreed semantics?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2018-09-14 17:25:53


> What is boost-dev's opinion on this proposed change in semantics?

On the basis that nobody argued against the proposed breaking interface
change, I just sent in a commit which prints the following compile time
error if an attempt is made to wide observe a
result/std_result/boost_result, or outcome/std_outcome/boost_outcome,
where it has an EC or EP which is a UDT:

"Attempt to wide observe value, error or exception for a result/outcome
given an EC or E type which is not void, and for whom
trait::has_error_code_v<EC>, trait::has_exception_ptr_v<EC>, and
trait::has_exception_ptr_v<E> are all false. Please specify a
NoValuePolicy to tell result/outcome what to do, or else use a more
specific convenience type alias such as unchecked<T, E> to indicate you
want the wide observers to be narrow, or checked<T, E> to indicate you
always want an exception throw etc."

Which is a bit laboured as far as compile time errors go, but is
certainly helpful.

Thanks to everybody who contributed discussion on this question.

Niall


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