On Mon, Jun 12, 2017 at 2:42 AM, Niall Douglas via Boost < boost@lists.boost.org> wrote:
On 12/06/2017 09:22, Emil Dotchevski via Boost wrote:
The lively debates during the Outcome review show that there is a great deal of interest in solving the problem of error handling in environments where C++ exception handling is unavailable.
Noexcept is a new C++11 library that implements a different approach to solving the same problem. Any feedback is welcome.
The use of functional throw(), try() and catch() was a design approach rejected very early by me and most who have looked into this problem.
Nobody wants to reimplement via a library exception handling with exceptions disabled. It's an impoverished experience, and leads to brittle code.
Can you elaborate? My understanding is that the problem with exception
handling is the unpredictability of the performance you'll get. Noexcept
directly addresses that issue by not introducing the unpredictability of
its own return type which may or may not get optimized.
It also removes the redundancy of requiring types which already have a
useful empty state to be wrapped into something like outcome<>. Nobody
would return optional
Just enable C++ exceptions if you want exceptions.
I agree, the question is what to do if you can't. Emil