Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Prev Up HomeNext


Policy class defining that bad_result_access_with<EC> should be thrown on incorrect wide value observation. The primary purpose of this policy is to enable standing in for P0323 std::expected<T, E> which throws a bad_expected_access<E> on incorrect wide value observation. This is why it is only ever EC which is thrown with bad_result_access_with<EC> on value observation only, and only when there is an error available.

If used in basic_outcome, and the outcome is exceptioned and so no error is available, incorrect wide value observation performs instead:

BOOST_OUTCOME_THROW_EXCEPTION(bad_result_access("no value"));

Incorrect wide error observation performs:

BOOST_OUTCOME_THROW_EXCEPTION(bad_result_access("no error"));

Incorrect wide exception observation performs:

BOOST_OUTCOME_THROW_EXCEPTION(bad_outcome_access("no exception"));

Inherits publicly from base , and its narrow value, error and exception observer policies are inherited from there.

Requires: Nothing.


Header: <boost/outcome/policy/throw_bad_result_access.hpp>

Last revised: January 23, 2019 at 01:27:31 UTC

Prev Up HomeNext