Boost C++ Libraries

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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
Prev Up HomeNext

fail_to_compile_observers

Upon attempting to compile the wide observer policy functions, the following static assertion occurs which fails the build:

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, trait::has_exception_ptr_v, and trait::has_exception_ptr_v 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 to indicate you want the wide observers to be narrow, or checked to indicate you always want an exception throw etc.

This failure to compile was introduced after the Boost peer review of v2.0 of Outcome due to feedback that users were too often surprised by the default selection of the all_narrow policy if the types were unrecognised. It was felt this introduced too much danger in the default configuration, so to ensure that existing code based on Outcome broke very loudly after an upgrade, the above very verbose static assertion was implemented.

Requires: Nothing.

Namespace: BOOST_OUTCOME_V2_NAMESPACE::policy

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

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


Prev Up HomeNext