Exception type publicly inheriting from
, and thus also
, indicating an incorrect observation of value occurred. The error value at the time of the exception throw is moved or copied into this type, and is available using the
.error() observer which comes in lvalue ref, const lvalue ref, rvalue ref, and const rvalue ref overloads.
The primary purpose of this exception type is to enable standing in for
bad_expected_access<E> which is thrown 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. See the
policy for more information.