├── .boostify ├── .ci.cmake ├── .clang-format ├── .clang-format-ignore ├── .clang-tidy ├── .docs.cmake ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── abi_stability.yml │ ├── documentation.yml │ ├── installability.yml │ ├── make_release.yml │ ├── unittests_freebsd.yml.disabled │ ├── unittests_linux.yml │ ├── unittests_macos.yml │ └── unittests_windows.yml ├── .gitignore ├── .gitmodules ├── .quickcpplib ├── CMakeLists.txt ├── CTestConfig.cmake ├── Doxyfile ├── Licence.txt ├── Readme.md ├── abi-compliance ├── CMakeLists.txt ├── Readme.md ├── abi_dumps │ └── Outcome │ │ └── 2.2.tar.bz2 ├── check-abi.sh ├── check-abigail.sh ├── check-api-abi.sh ├── dump-abi.sh ├── dump-abigail.sh ├── dump-api-abi.sh └── src │ └── main.cpp ├── attic ├── .travis.yml └── appveyor.yml ├── benchmark ├── benchmark.py ├── historical │ └── results.v1v2.xlsx ├── results-darwin.csv ├── results-linux2.csv ├── results-win32.csv ├── runner.cpp ├── timing.h ├── v2.0 │ └── results.v2.0.xlsx └── v2.1 │ ├── results.v2.1.0.xlsx │ ├── v2.1.0_results_arm_a53_linear.png │ ├── v2.1.0_results_arm_a53_linear_sm.png │ ├── v2.1.0_results_arm_a53_log.png │ ├── v2.1.0_results_arm_a53_log_sm.png │ ├── v2.1.0_results_arm_a72_linear.png │ ├── v2.1.0_results_arm_a72_linear_sm.png │ ├── v2.1.0_results_arm_a72_log.png │ ├── v2.1.0_results_arm_a72_log_sm.png │ ├── v2.1.0_results_silvermont_linear.png │ ├── v2.1.0_results_silvermont_linear_sm.png │ ├── v2.1.0_results_silvermont_log.png │ ├── v2.1.0_results_silvermont_log_sm.png │ ├── v2.1.0_results_skylake_linear.png │ ├── v2.1.0_results_skylake_linear_sm.png │ ├── v2.1.0_results_skylake_log.png │ ├── v2.1.0_results_skylake_log_sm.png │ ├── v2.1.3_results_threadripper_linear.png │ └── v2.1.3_results_threadripper_log.png ├── boostify ├── .drone.star ├── .drone │ └── drone.sh ├── .github │ ├── FUNDING.yml │ ├── actions │ │ ├── boost_clone │ │ │ └── action.yml │ │ └── cmake_run │ │ │ └── action.yml │ └── workflows │ │ └── ci.yml ├── .travis.yml ├── CMakeLists.txt ├── Readme.md ├── build.jam ├── doc │ ├── Readme.md │ └── src │ │ └── config.toml ├── include │ └── boost │ │ ├── outcome.hpp │ │ └── outcome │ │ ├── config.hpp │ │ ├── outcome.hpp │ │ └── result.hpp ├── meta │ ├── explicit-failures-markup.xml │ └── libraries.json └── test │ ├── CMakeLists.txt │ └── Jamfile.v2 ├── cmake ├── QuickCppLibBootstrap.cmake ├── headers.cmake ├── interface.cmake ├── tests.cmake └── toolchain-linux-libc++.cmake ├── conan ├── conanfile.py └── test_package │ ├── CMakeLists.txt │ ├── conanfile.py │ └── example.cpp ├── doc ├── presentations │ ├── 20170429_ACCU 2017 Presentation.pdf │ ├── 20171110_Meeting C++ 2017 Presentation.pdf │ ├── 20180917_CPPDUG 2018 Presentation.pdf │ └── videos.txt └── src │ ├── config.toml │ ├── content │ ├── _footer.md │ ├── _header.md │ ├── _index.md │ ├── abi-stability │ │ └── _index.md │ ├── alternatives │ │ ├── _index.md │ │ ├── error_code.md │ │ ├── exceptions.md │ │ ├── expected.md │ │ ├── leaf.md │ │ └── outcome.md │ ├── build │ │ └── _index.md │ ├── changelog │ │ ├── _index.md │ │ ├── upgrade_v21_v22.md │ │ └── v22.md │ ├── credits.md │ ├── experimental │ │ ├── _index.md │ │ ├── advantages.md │ │ ├── c-api │ │ │ ├── _index.md │ │ │ ├── from-c │ │ │ │ ├── _index.md │ │ │ │ ├── declare.md │ │ │ │ ├── system_code.md │ │ │ │ ├── try.md │ │ │ │ └── use.md │ │ │ └── from-cxx │ │ │ │ ├── _index.md │ │ │ │ ├── example.md │ │ │ │ └── example2.md │ │ ├── differences.md │ │ ├── map.md │ │ ├── outcome.md │ │ ├── status_result.md │ │ ├── worked-example-long │ │ │ ├── _index.md │ │ │ ├── constructor.md │ │ │ ├── implicit_conversion.md │ │ │ ├── message.md │ │ │ ├── preamble.md │ │ │ ├── source.md │ │ │ ├── string_ref.md │ │ │ └── value_type.md │ │ └── worked-example │ │ │ ├── _index.md │ │ │ └── implicit-construction.md │ ├── faq │ │ ├── _index.md │ │ ├── results_arm_a53_log.png │ │ ├── results_arm_a72_log.png │ │ ├── results_silvermont_log.png │ │ └── results_skylake_log.png │ ├── history │ │ ├── _index.md │ │ └── graph.png │ ├── motivation │ │ ├── _index.md │ │ ├── errno.md │ │ ├── error_codes.md │ │ ├── exceptions.md │ │ ├── narrow_contract.md │ │ ├── plug_error_code.md │ │ ├── plug_error_code2.md │ │ └── std_error_code.md │ ├── recipes │ │ ├── _index.md │ │ ├── asio-integration-1-70.md │ │ ├── asio-integration.md │ │ ├── foreign-try.md │ │ └── rust.md │ ├── reference │ │ ├── _index.md │ │ ├── aliases │ │ │ ├── _index.md │ │ │ ├── boost_checked.md │ │ │ ├── boost_outcome.md │ │ │ ├── boost_result.md │ │ │ ├── boost_unchecked.md │ │ │ ├── checked.md │ │ │ ├── default_policy.md │ │ │ ├── outcome.md │ │ │ ├── result.md │ │ │ ├── std_checked.md │ │ │ ├── std_outcome.md │ │ │ ├── std_result.md │ │ │ ├── std_unchecked.md │ │ │ └── unchecked.md │ │ ├── concepts │ │ │ ├── _index.md │ │ │ ├── basic_outcome.md │ │ │ ├── basic_result.md │ │ │ ├── value_or_error.md │ │ │ └── value_or_none.md │ │ ├── converters │ │ │ ├── _index.md │ │ │ └── value_or_error.md │ │ ├── functions │ │ │ ├── _index.md │ │ │ ├── error_from_exception.md │ │ │ ├── failure.md │ │ │ ├── hooks │ │ │ │ ├── _index.md │ │ │ │ ├── hook_outcome_construction.md │ │ │ │ ├── hook_outcome_construction2.md │ │ │ │ ├── hook_outcome_copy_construction.md │ │ │ │ ├── hook_outcome_copy_construction2.md │ │ │ │ ├── hook_outcome_in_place_construction.md │ │ │ │ ├── hook_outcome_move_construction.md │ │ │ │ ├── hook_outcome_move_construction2.md │ │ │ │ ├── hook_result_construction.md │ │ │ │ ├── hook_result_copy_construction.md │ │ │ │ ├── hook_result_in_place_construction.md │ │ │ │ ├── hook_result_move_construction.md │ │ │ │ ├── override_outcome_exception.md │ │ │ │ ├── set_spare_storage.md │ │ │ │ └── spare_storage.md │ │ │ ├── iostream │ │ │ │ ├── _index.md │ │ │ │ ├── outcome_operator_in.md │ │ │ │ ├── outcome_operator_out.md │ │ │ │ ├── outcome_print.md │ │ │ │ ├── result_operator_in.md │ │ │ │ ├── result_operator_out.md │ │ │ │ └── result_print.md │ │ │ ├── policy │ │ │ │ ├── _index.md │ │ │ │ ├── basic_outcome_failure_exception_from_error.md │ │ │ │ ├── error_code.md │ │ │ │ ├── exception_ptr.md │ │ │ │ ├── outcome_throw_as_system_error_with_payload_boost_enum.md │ │ │ │ ├── outcome_throw_as_system_error_with_payload_boost_error_code.md │ │ │ │ ├── outcome_throw_as_system_error_with_payload_std_enum.md │ │ │ │ └── outcome_throw_as_system_error_with_payload_std_error_code.md │ │ │ ├── strong_swap.md │ │ │ ├── success.md │ │ │ ├── try_operation_extract_value.md │ │ │ ├── try_operation_has_value.md │ │ │ ├── try_operation_return_as.md │ │ │ └── try_throw_std_exception_from_error.md │ │ ├── macros │ │ │ ├── _index.md │ │ │ ├── co_try.md │ │ │ ├── co_try_failure_likely.md │ │ │ ├── co_tryv.md │ │ │ ├── co_tryv2.md │ │ │ ├── co_tryv2_failure_likely.md │ │ │ ├── co_tryv_failure_likely.md │ │ │ ├── co_tryx.md │ │ │ ├── co_tryx_failure_likely.md │ │ │ ├── disable_execinfo.md │ │ │ ├── enable_legacy_support_for.md │ │ │ ├── in_place_type.md │ │ │ ├── is_nothrow_swappable.md │ │ │ ├── nodiscard.md │ │ │ ├── requires.md │ │ │ ├── symbol_visible.md │ │ │ ├── template.md │ │ │ ├── thread_local.md │ │ │ ├── throw_exception.md │ │ │ ├── try.md │ │ │ ├── try_failure_likely.md │ │ │ ├── tryv.md │ │ │ ├── tryv2.md │ │ │ ├── tryv2_failure_likely.md │ │ │ ├── tryv_failure_likely.md │ │ │ ├── tryx.md │ │ │ ├── tryx_failure_likely.md │ │ │ └── version.md │ │ ├── policies │ │ │ ├── _index.md │ │ │ ├── all_narrow.md │ │ │ ├── base │ │ │ │ ├── _index.md │ │ │ │ ├── error.md │ │ │ │ ├── exception.md │ │ │ │ ├── has_error.md │ │ │ │ ├── has_error_is_errno.md │ │ │ │ ├── has_exception.md │ │ │ │ ├── has_value.md │ │ │ │ ├── narrow_error_check.md │ │ │ │ ├── narrow_exception_check.md │ │ │ │ ├── narrow_value_check.md │ │ │ │ ├── on_outcome_construction.md │ │ │ │ ├── on_outcome_construction2.md │ │ │ │ ├── on_outcome_copy_construction.md │ │ │ │ ├── on_outcome_copy_construction2.md │ │ │ │ ├── on_outcome_in_place_construction.md │ │ │ │ ├── on_outcome_move_construction.md │ │ │ │ ├── on_outcome_move_construction2.md │ │ │ │ ├── on_result_construction.md │ │ │ │ ├── on_result_copy_construction.md │ │ │ │ ├── on_result_in_place_construction.md │ │ │ │ ├── on_result_move_construction.md │ │ │ │ ├── set_has_error.md │ │ │ │ ├── set_has_error_is_errno.md │ │ │ │ ├── set_has_exception.md │ │ │ │ ├── set_has_value.md │ │ │ │ ├── ub.md │ │ │ │ └── value.md │ │ │ ├── error_code_throw_as_system_error_outcome.md │ │ │ ├── error_code_throw_as_system_error_result.md │ │ │ ├── exception_ptr_rethrow_outcome.md │ │ │ ├── exception_ptr_rethrow_result.md │ │ │ ├── fail_to_compile_observers.md │ │ │ ├── terminate.md │ │ │ └── throw_bad_result_access.md │ │ ├── traits │ │ │ ├── _index.md │ │ │ ├── is_basic_outcome.md │ │ │ ├── is_basic_result.md │ │ │ ├── is_error_code_available.md │ │ │ ├── is_error_type.md │ │ │ ├── is_error_type_enum.md │ │ │ ├── is_exception_ptr_available.md │ │ │ ├── is_failure_type.md │ │ │ ├── is_move_bitcopying.md │ │ │ ├── is_success_type.md │ │ │ └── type_can_be_used_in_basic_result.md │ │ └── types │ │ │ ├── _index.md │ │ │ ├── awaitables │ │ │ ├── eager.md │ │ │ ├── generator.md │ │ │ └── lazy.md │ │ │ ├── bad_outcome_access.md │ │ │ ├── bad_result_access.md │ │ │ ├── bad_result_access_with.md │ │ │ ├── basic_outcome │ │ │ ├── _index.md │ │ │ ├── as_failure_lvalue.md │ │ │ ├── as_failure_rvalue.md │ │ │ ├── assume_error_lvalue.md │ │ │ ├── assume_error_lvalue_const.md │ │ │ ├── assume_error_rvalue.md │ │ │ ├── assume_error_rvalue_const.md │ │ │ ├── assume_exception_lvalue.md │ │ │ ├── assume_exception_lvalue_const.md │ │ │ ├── assume_exception_rvalue.md │ │ │ ├── assume_exception_rvalue_const.md │ │ │ ├── assume_value_lvalue.md │ │ │ ├── assume_value_lvalue_const.md │ │ │ ├── assume_value_rvalue.md │ │ │ ├── assume_value_rvalue_const.md │ │ │ ├── copy_assignment.md │ │ │ ├── copy_constructor.md │ │ │ ├── default.md │ │ │ ├── destructor.md │ │ │ ├── disabling_catchall.md │ │ │ ├── disabling_implicit_constructor.md │ │ │ ├── equality_basic_outcome.md │ │ │ ├── equality_basic_result.md │ │ │ ├── equality_failure_type.md │ │ │ ├── equality_success_type.md │ │ │ ├── error_lvalue.md │ │ │ ├── error_lvalue_const.md │ │ │ ├── error_rvalue.md │ │ │ ├── error_rvalue_const.md │ │ │ ├── exception_lvalue.md │ │ │ ├── exception_lvalue_const.md │ │ │ ├── exception_rvalue.md │ │ │ ├── exception_rvalue_const.md │ │ │ ├── explicit_copy_converting_constructor.md │ │ │ ├── explicit_inplace_error_constructor.md │ │ │ ├── explicit_inplace_error_constructor_il.md │ │ │ ├── explicit_inplace_exception_constructor.md │ │ │ ├── explicit_inplace_exception_constructor_il.md │ │ │ ├── explicit_inplace_value_constructor.md │ │ │ ├── explicit_inplace_value_constructor_il.md │ │ │ ├── explicit_move_converting_constructor.md │ │ │ ├── explicit_result_copy_converting_constructor.md │ │ │ ├── explicit_result_make_error_code_copy_converting_constructor.md │ │ │ ├── explicit_result_make_error_code_move_converting_constructor.md │ │ │ ├── explicit_result_move_converting_constructor.md │ │ │ ├── explicit_valueorerror_converting_constructor.md │ │ │ ├── failure.md │ │ │ ├── has_error.md │ │ │ ├── has_exception.md │ │ │ ├── has_failure.md │ │ │ ├── has_value.md │ │ │ ├── implicit_error_condition_converting_constructor.md │ │ │ ├── implicit_error_converting_constructor.md │ │ │ ├── implicit_error_exception_converting_constructor.md │ │ │ ├── implicit_exception_converting_constructor.md │ │ │ ├── implicit_failure_error_copy_constructor.md │ │ │ ├── implicit_failure_error_exception_copy_constructor.md │ │ │ ├── implicit_failure_error_exception_move_constructor.md │ │ │ ├── implicit_failure_error_make_error_code_copy_constructor.md │ │ │ ├── implicit_failure_error_make_error_code_move_constructor.md │ │ │ ├── implicit_failure_error_move_constructor.md │ │ │ ├── implicit_failure_exception_copy_constructor.md │ │ │ ├── implicit_failure_exception_move_constructor.md │ │ │ ├── implicit_inplace_value_error_exception_constructor.md │ │ │ ├── implicit_success_copy_constructor.md │ │ │ ├── implicit_success_move_constructor.md │ │ │ ├── implicit_value_converting_constructor.md │ │ │ ├── inequality_basic_outcome.md │ │ │ ├── inequality_basic_result.md │ │ │ ├── inequality_failure_type.md │ │ │ ├── inequality_success_type.md │ │ │ ├── move_assignment.md │ │ │ ├── move_constructor.md │ │ │ ├── operator_bool.md │ │ │ ├── swap.md │ │ │ ├── value_lvalue.md │ │ │ ├── value_lvalue_const.md │ │ │ ├── value_rvalue.md │ │ │ └── value_rvalue_const.md │ │ │ ├── basic_result │ │ │ ├── _index.md │ │ │ ├── as_failure_lvalue.md │ │ │ ├── as_failure_rvalue.md │ │ │ ├── assume_error_lvalue.md │ │ │ ├── assume_error_lvalue_const.md │ │ │ ├── assume_error_rvalue.md │ │ │ ├── assume_error_rvalue_const.md │ │ │ ├── assume_value_lvalue.md │ │ │ ├── assume_value_lvalue_const.md │ │ │ ├── assume_value_rvalue.md │ │ │ ├── assume_value_rvalue_const.md │ │ │ ├── copy_assignment.md │ │ │ ├── copy_constructor.md │ │ │ ├── default.md │ │ │ ├── destructor.md │ │ │ ├── disabling_catchall.md │ │ │ ├── disabling_implicit_constructor.md │ │ │ ├── equality_basic_result.md │ │ │ ├── equality_failure_type.md │ │ │ ├── equality_success_type.md │ │ │ ├── error_lvalue.md │ │ │ ├── error_lvalue_const.md │ │ │ ├── error_rvalue.md │ │ │ ├── error_rvalue_const.md │ │ │ ├── explicit_copy_converting_constructor.md │ │ │ ├── explicit_inplace_error_constructor.md │ │ │ ├── explicit_inplace_error_constructor_il.md │ │ │ ├── explicit_inplace_value_constructor.md │ │ │ ├── explicit_inplace_value_constructor_il.md │ │ │ ├── explicit_make_error_code_copy_converting_constructor.md │ │ │ ├── explicit_make_error_code_move_converting_constructor.md │ │ │ ├── explicit_make_exception_ptr_copy_converting_constructor.md │ │ │ ├── explicit_make_exception_ptr_move_converting_constructor.md │ │ │ ├── explicit_move_converting_constructor.md │ │ │ ├── explicit_valueorerror_converting_constructor.md │ │ │ ├── has_error.md │ │ │ ├── has_exception.md │ │ │ ├── has_failure.md │ │ │ ├── has_lost_consistency.md │ │ │ ├── has_value.md │ │ │ ├── implicit_error_condition_converting_constructor.md │ │ │ ├── implicit_error_converting_constructor.md │ │ │ ├── implicit_failure_copy_constructor.md │ │ │ ├── implicit_failure_make_error_code_copy_constructor.md │ │ │ ├── implicit_failure_make_error_code_move_constructor.md │ │ │ ├── implicit_failure_make_exception_ptr_copy_constructor.md │ │ │ ├── implicit_failure_make_exception_ptr_move_constructor.md │ │ │ ├── implicit_failure_move_constructor.md │ │ │ ├── implicit_inplace_value_error_constructor.md │ │ │ ├── implicit_success_copy_constructor.md │ │ │ ├── implicit_success_move_constructor.md │ │ │ ├── implicit_value_converting_constructor.md │ │ │ ├── inequality_basic_result.md │ │ │ ├── inequality_failure_type.md │ │ │ ├── inequality_success_type.md │ │ │ ├── move_assignment.md │ │ │ ├── move_constructor.md │ │ │ ├── operator_bool.md │ │ │ ├── swap.md │ │ │ ├── value_lvalue.md │ │ │ ├── value_lvalue_const.md │ │ │ ├── value_rvalue.md │ │ │ └── value_rvalue_const.md │ │ │ ├── failure_type.md │ │ │ ├── in_place_type_t.md │ │ │ └── success_type.md │ ├── requirements │ │ └── _index.md │ ├── tutorial │ │ ├── _index.md │ │ ├── advanced │ │ │ ├── _index.md │ │ │ ├── constructors │ │ │ │ ├── _index.md │ │ │ │ ├── file_handle.md │ │ │ │ ├── metaprogrammg1.md │ │ │ │ ├── metaprogrammg2.md │ │ │ │ ├── metaprogrammg3.md │ │ │ │ ├── static-constructor.md │ │ │ │ └── two-phase-init.md │ │ │ ├── hooks │ │ │ │ ├── _index.md │ │ │ │ ├── adl_bridging.md │ │ │ │ ├── hook_outcome.md │ │ │ │ ├── hook_result.md │ │ │ │ ├── keeping_state.md │ │ │ │ └── poke_exception.md │ │ │ ├── interop │ │ │ │ ├── _index.md │ │ │ │ ├── app-go.md │ │ │ │ ├── app-map-filelib.md │ │ │ │ ├── app-map-httplib1.md │ │ │ │ ├── app-map-httplib2.md │ │ │ │ ├── app-map-tidylib.md │ │ │ │ ├── app.md │ │ │ │ ├── conclusion.md │ │ │ │ ├── filelib.md │ │ │ │ ├── httplib.md │ │ │ │ ├── problem.md │ │ │ │ ├── tidylib.md │ │ │ │ └── value-or-error.md │ │ │ └── payload │ │ │ │ ├── _index.md │ │ │ │ ├── copy_file.md │ │ │ │ ├── copy_file2.md │ │ │ │ └── copy_file3.md │ │ └── essential │ │ │ ├── _index.md │ │ │ ├── before.md │ │ │ ├── conventions │ │ │ └── _index.md │ │ │ ├── coroutines │ │ │ ├── _index.md │ │ │ ├── awaitables.md │ │ │ ├── co_await.md │ │ │ ├── returning.md │ │ │ └── try.md │ │ │ ├── no-value │ │ │ ├── _index.md │ │ │ ├── builtin.md │ │ │ └── custom.md │ │ │ ├── outcome │ │ │ ├── _index.md │ │ │ ├── inspecting.md │ │ │ └── layer_chart.gif │ │ │ └── result │ │ │ ├── _index.md │ │ │ ├── inspecting.md │ │ │ ├── try.md │ │ │ ├── try_greedy.md │ │ │ └── try_ref.md │ └── videos │ │ └── _index.md │ ├── layouts │ ├── partials │ │ ├── custom-head.html │ │ ├── flex │ │ │ └── body-beforecontent.html │ │ ├── menu.html │ │ └── next-prev-page.html │ └── shortcodes │ │ ├── api.html │ │ ├── boost-copyright.html │ │ ├── children.html │ │ ├── figure.html │ │ ├── ghcontributors.html │ │ ├── if_boost.html │ │ ├── slides.html │ │ ├── snippet.md │ │ └── toc.html │ ├── snippets │ ├── boost-only │ │ ├── asio_integration.cpp │ │ ├── asio_integration_1_70.cpp │ │ └── error_code_registration.cpp │ ├── c_api.c │ ├── c_api2.cpp │ ├── constructors.cpp │ ├── cpp_api.cpp │ ├── error_code_enums1.cpp │ ├── error_code_enums2.cpp │ ├── error_code_extended.cpp │ ├── error_code_registration.cpp │ ├── exception_ptr.cpp │ ├── expected_implementation.cpp │ ├── experimental_status_code.cpp │ ├── finale.cpp │ ├── foreign_try.cpp │ ├── intro_c_example.cpp │ ├── intro_example.cpp │ ├── outcome_payload.cpp │ ├── policies.cpp │ ├── quick_status_code_from_enum.cpp │ ├── udts.cpp │ ├── using_outcome.cpp │ ├── using_result.cpp │ └── void_terminate.cpp │ └── static │ └── css │ └── local.css ├── include ├── outcome.hpp ├── outcome.ixx └── outcome │ ├── bad_access.hpp │ ├── basic_outcome.hpp │ ├── basic_result.hpp │ ├── boost_outcome.hpp │ ├── boost_result.hpp │ ├── config.hpp │ ├── convert.hpp │ ├── coroutine_support.hpp │ ├── detail │ ├── basic_outcome_exception_observers.hpp │ ├── basic_outcome_exception_observers_impl.hpp │ ├── basic_outcome_failure_observers.hpp │ ├── basic_result_error_observers.hpp │ ├── basic_result_final.hpp │ ├── basic_result_storage.hpp │ ├── basic_result_value_observers.hpp │ ├── coroutine_support.ipp │ ├── revision.hpp │ ├── trait_std_error_code.hpp │ ├── trait_std_exception.hpp │ ├── try.h │ ├── value_storage.hpp │ └── version.hpp │ ├── experimental │ ├── coroutine_support.hpp │ ├── result.h │ ├── status_outcome.hpp │ └── status_result.hpp │ ├── iostream_support.hpp │ ├── iostream_support_result.hpp │ ├── outcome.hpp │ ├── outcome.natvis │ ├── outcome_gdb.h │ ├── outcome_gdb.py │ ├── policy │ ├── all_narrow.hpp │ ├── base.hpp │ ├── fail_to_compile_observers.hpp │ ├── outcome_error_code_throw_as_system_error.hpp │ ├── outcome_exception_ptr_rethrow.hpp │ ├── result_error_code_throw_as_system_error.hpp │ ├── result_exception_ptr_rethrow.hpp │ ├── terminate.hpp │ └── throw_bad_result_access.hpp │ ├── result.hpp │ ├── std_outcome.hpp │ ├── std_result.hpp │ ├── success_failure.hpp │ ├── trait.hpp │ ├── try.hpp │ └── utils.hpp ├── index.html ├── install_dev_githooks.sh ├── make_reference_docs.py ├── single-header ├── Readme.md ├── outcome-basic.hpp ├── outcome-experimental.hpp └── outcome.hpp └── test ├── compile-fail ├── issue0071-fail.cpp ├── outcome-int-int-1.cpp ├── result-int-int-1.cpp └── result-int-int-2.cpp ├── constexprs ├── .boostish ├── WG21_P1886.clang.S.test1.s ├── WG21_P1886.cpp ├── WG21_P1886.gcc.S.test1.s ├── WG21_P1886.msvc.S.test1.s ├── WG21_P1886a.clang.S.test1.s ├── WG21_P1886a.cpp ├── WG21_P1886a.gcc.S.test1.s ├── WG21_P1886a.msvc.S.test1.s ├── clang.csv ├── compile_and_count.py ├── count_opcodes.py ├── gcc.csv ├── max_result_construct_value_move_destruct.clang.S.test1.s ├── max_result_construct_value_move_destruct.cpp ├── max_result_construct_value_move_destruct.gcc.S.test1.s ├── max_result_construct_value_move_destruct.msvc.S.test1.s ├── max_result_get_value.clang.S.test1.s ├── max_result_get_value.cpp ├── max_result_get_value.gcc.S.test1.s ├── max_result_get_value.msvc.S.test1.s ├── min_result_construct_value_move_destruct.clang.S.test1.s ├── min_result_construct_value_move_destruct.cpp ├── min_result_construct_value_move_destruct.gcc.S.test1.s ├── min_result_construct_value_move_destruct.msvc.S.test1.s ├── min_result_get_value.clang.S.test1.s ├── min_result_get_value.cpp ├── min_result_get_value.gcc.S.test1.s ├── min_result_get_value.msvc.S.test1.s └── msvc.csv ├── expected-pass.cpp ├── link ├── CMakeLists.txt └── experimental-c-result │ ├── lib.c │ ├── lib.cpp │ ├── lib.h │ └── main.c ├── single-header-test.cpp └── tests ├── comparison.cpp ├── constexpr.cpp ├── containers.cpp ├── core-outcome.cpp ├── core-result.cpp ├── coroutine-support.cpp ├── default-construction.cpp ├── experimental-c-result.cpp ├── experimental-core-outcome-status.cpp ├── experimental-core-result-status.cpp ├── experimental-p0709a.cpp ├── fileopen.cpp ├── hooks.cpp ├── issue0007.cpp ├── issue0009.cpp ├── issue0010.cpp ├── issue0012.cpp ├── issue0016.cpp ├── issue0059.cpp ├── issue0061.cpp ├── issue0064.cpp ├── issue0065.cpp ├── issue0071.cpp ├── issue0095.cpp ├── issue0115.cpp ├── issue0116.cpp ├── issue0140.cpp ├── issue0182.cpp ├── issue0203.cpp ├── issue0210.cpp ├── issue0220.cpp ├── issue0244.cpp ├── issue0247.cpp ├── issue0255.cpp ├── issue0259.cpp ├── issue0291.cpp ├── noexcept-propagation.cpp ├── propagate.cpp ├── serialisation.cpp ├── success-failure.cpp ├── swap.cpp ├── udts.cpp └── value-or-error.cpp /.clang-format-ignore: -------------------------------------------------------------------------------- 1 | single-header/.* 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: ned14 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.cache 2 | doc/outcome.hpp 3 | doc/src/public 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "doc/html"] 2 | path = doc/html 3 | url = https://github.com/ned14/outcome.git 4 | branch = gh-pages 5 | fetchRecurseSubmodules = true 6 | ignore = none 7 | # shallow = true ## master repo is always somewhat behind 8 | [submodule "doc/src/themes/docdock"] 9 | path = doc/src/themes/docdock 10 | url = https://github.com/ned14/hugo-theme-docdock.git 11 | [submodule "doc/src/themes/boostdoc"] 12 | path = doc/src/themes/boostdoc 13 | url = https://github.com/ned14/boostdoc.git 14 | branch = master 15 | [submodule "include/outcome/status-code"] 16 | path = include/outcome/experimental/status-code 17 | url = https://github.com/ned14/status-code.git 18 | branch = master 19 | fetchRecurseSubmodules = true 20 | ignore = untracked 21 | -------------------------------------------------------------------------------- /.quickcpplib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/.quickcpplib -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | ## This file should be placed in the root directory of your project. 2 | ## Then modify the CMakeLists.txt file in the root directory of your 3 | ## project to incorporate the testing dashboard. 4 | ## 5 | ## # The following are required to submit to the CDash dashboard: 6 | ## ENABLE_TESTING() 7 | ## INCLUDE(CTest) 8 | 9 | set(CTEST_PROJECT_NAME "Boost.Outcome") 10 | set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") 11 | 12 | set(CTEST_DROP_METHOD "https") 13 | set(CTEST_DROP_SITE "my.cdash.org") 14 | set(CTEST_DROP_LOCATION "/submit.php?project=Boost.Outcome") 15 | set(CTEST_DROP_SITE_CDASH TRUE) 16 | -------------------------------------------------------------------------------- /abi-compliance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1 FATAL_ERROR) 2 | 3 | if(NOT DEFINED LABEL) 4 | set(LABEL default) 5 | endif() 6 | 7 | project(outcome-abi-test VERSION 1.0 LANGUAGES CXX) 8 | set(OUTCOME_FORCE_ENABLE_PP_TARGETS TRUE) 9 | add_subdirectory(.. outcome EXCLUDE_FROM_ALL) 10 | 11 | add_library(outcome-abi-lib-${LABEL} SHARED "src/main.cpp") 12 | target_link_libraries(outcome-abi-lib-${LABEL} PUBLIC outcome::hl) 13 | add_dependencies(outcome-abi-lib-${LABEL} outcome_hl-pp-std) 14 | target_compile_definitions(outcome-abi-lib-${LABEL} PUBLIC OUTCOME_DISABLE_ABI_PERMUTATION=1) 15 | if(NOT MSVC) 16 | target_compile_options(outcome-abi-lib-${LABEL} PUBLIC -Og) 17 | endif() 18 | -------------------------------------------------------------------------------- /abi-compliance/abi_dumps/Outcome/2.2.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/abi-compliance/abi_dumps/Outcome/2.2.tar.bz2 -------------------------------------------------------------------------------- /abi-compliance/check-abi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf abi_dumps/Outcome/test-gcc13-cxx17/binary_only.dump 3 | rm -rf abi_dumps/Outcome/test-gcc13-cxx20/binary_only.dump 4 | sh ./dump-abi.sh test || exit 1 5 | cd abi_dumps/Outcome 6 | tar xf $1.tar.bz2 7 | cd ../.. 8 | RETCODE=0 9 | abi-compliance-checker -l Outcome -old abi_dumps/Outcome/$1-gcc13-cxx17/binary_only.dump -new abi_dumps/Outcome/test-gcc13-cxx17/binary_only.dump || RETCODE=1 10 | abi-compliance-checker -l Outcome -old abi_dumps/Outcome/$1-gcc13-cxx20/binary_only.dump -new abi_dumps/Outcome/test-gcc13-cxx20/binary_only.dump || RETCODE=1 11 | exit $RETCODE 12 | -------------------------------------------------------------------------------- /abi-compliance/check-abigail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -rf abi_dumps/Outcome/test-gcc13-cxx17/abigail.xml 3 | rm -rf abi_dumps/Outcome/test-gcc13-cxx20/abigail.xml 4 | sh ./dump-abigail.sh test || exit 1 5 | cd abi_dumps/Outcome 6 | tar xf $1.tar.bz2 7 | cd ../.. 8 | RETCODE=0 9 | abidiff --stats --deleted-fns --changed-fns --deleted-vars --changed-vars abi_dumps/Outcome/$1-gcc13-cxx17/abigail.xml abi_dumps/Outcome/test-gcc13-cxx17/abigail.xml 10 | (( RETCODE=$RETCODE || ($? & 11) )) 11 | echo Check returns $RETCODE 12 | abidiff --stats --deleted-fns --changed-fns --deleted-vars --changed-vars abi_dumps/Outcome/$1-gcc13-cxx20/abigail.xml abi_dumps/Outcome/test-gcc13-cxx20/abigail.xml 13 | (( RETCODE=$RETCODE || ($? & 11) )) 14 | echo Check returns $RETCODE 15 | exit $RETCODE 16 | -------------------------------------------------------------------------------- /abi-compliance/check-api-abi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sh ./dump-api-abi.sh test || exit 1 3 | cd abi_dumps/Outcome 4 | tar xf $1.tar.bz2 5 | cd ../.. 6 | RETCODE=0 7 | #abi-compliance-checker -l Outcome -old abi_dumps/Outcome/$1-gcc7-cxx14/ABI.dump -new abi_dumps/Outcome/X/ABI.dump || RETCODE=1 8 | abi-compliance-checker -l Outcome -old abi_dumps/Outcome/$1-gcc9-cxx17/ABI.dump -new abi_dumps/Outcome/X/ABI.dump || RETCODE=1 9 | exit $RETCODE 10 | -------------------------------------------------------------------------------- /abi-compliance/dump-abi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | mkdir -p build-gcc13-cxx17 3 | cd build-gcc13-cxx17 4 | CXX=g++ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=17 -DLABEL=gcc13-cxx17 5 | cmake --build . 6 | cd .. 7 | mkdir -p build-gcc13-cxx20 8 | cd build-gcc13-cxx20 9 | CXX=g++ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=20 -DLABEL=gcc13-cxx20 10 | cmake --build . 11 | cd .. 12 | 13 | if [ $# -eq 0 ]; then 14 | DUMPFILE=2.2 15 | else 16 | DUMPFILE=$1 17 | fi 18 | RETCODE=0 19 | abi-dumper -o abi_dumps/Outcome/$DUMPFILE-gcc13-cxx17/binary_only.dump -vnum $DUMPFILE-gcc13-cxx17 build-gcc13-cxx17/liboutcome-abi-lib-gcc13-cxx17.so || RETCODE=1 20 | abi-dumper -o abi_dumps/Outcome/$DUMPFILE-gcc13-cxx20/binary_only.dump -vnum $DUMPFILE-gcc13-cxx20 build-gcc13-cxx20/liboutcome-abi-lib-gcc13-cxx20.so || RETCODE=1 21 | if [ $RETCODE -eq 0 ]; then 22 | cd abi_dumps/Outcome 23 | tar jcf $DUMPFILE.tar.bz2 $DUMPFILE-gcc13-cxx17 $DUMPFILE-gcc13-cxx20 || true 24 | cd ../.. 25 | fi 26 | exit $RETCODE 27 | -------------------------------------------------------------------------------- /attic/appveyor.yml: -------------------------------------------------------------------------------- 1 | # version format 2 | version: 2.00.{build}-{branch} 3 | 4 | # branches to build 5 | branches: 6 | only: 7 | - develop 8 | - better_optimisation 9 | skip_tags: true 10 | 11 | image: Visual Studio 2017 12 | init: 13 | - git config --global core.longpaths true 14 | 15 | clone_folder: c:\boost.outcome 16 | platform: 17 | - x86 18 | - x64 19 | configuration: Release 20 | 21 | before_build: 22 | - git checkout develop 23 | - git submodule update --init --recursive 24 | - pip install ply 25 | build_script: 26 | - if "%PLATFORM%" == "x86" set "CTEST_CONFIGURE_OPTIONS=-A Win32" 27 | - ctest -S .ci.cmake -V 28 | after_build: 29 | 30 | before_test: 31 | test_script: 32 | after_test: 33 | 34 | on_success: 35 | on_failure: 36 | on_finish: 37 | - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path cmake_ci\merged_junit_results.xml)) 38 | -------------------------------------------------------------------------------- /benchmark/historical/results.v1v2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/historical/results.v1v2.xlsx -------------------------------------------------------------------------------- /benchmark/results-darwin.csv: -------------------------------------------------------------------------------- 1 | "Compiler","integer-returns","exception-throw","expected-error-value","expected-error-error","expected-excpt-value","expected-excpt-error" 2 | "xcode82",86.842960,21292.326800,93.196520,96.521440,93.920760,3139.020760 3 | -------------------------------------------------------------------------------- /benchmark/results-linux2.csv: -------------------------------------------------------------------------------- 1 | "Compiler","integer-returns","exception-throw","result-error-value","result-error-error","result-excpt-value","result-excpt-error","result-exper-value","result-exper-error" 2 | "gcc74-noexcept",82.424570,,81.678510,82.764660,98.672160,202.434260,88.502730,85.552740 3 | "gcc74",82.707740,43545.583140,132.785690,85.397330,86.400290,481.477090,83.427460,86.688600 4 | "gcc74-lto",91.374140,4605.814490,92.731120,91.785890,93.126190,305.276510,87.292520,89.312990 5 | "clang80",80.194600,41319.487530,83.502340,93.954410,122.506200,388.193510,86.476020,83.911700 6 | -------------------------------------------------------------------------------- /benchmark/results-win32.csv: -------------------------------------------------------------------------------- 1 | "Compiler","integer-returns","exception-throw","result-error-value","result-error-error","result-excpt-value","result-excpt-error","result-exper-value","result-exper-error" 2 | "msvc1916-noexcept",101.840280,,130.262690,129.857850,109.720150,878.390900,95.226430,100.083460 3 | "msvc1916",84.069930,23286.521470,108.842160,172.748290,169.007720,1088.492910,81.561240,86.384540 4 | "msvc1916-ltcg",92.457910,23727.320940,88.352160,152.398800,92.102750,1205.165160,92.026020,92.419710 5 | -------------------------------------------------------------------------------- /benchmark/v2.0/results.v2.0.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.0/results.v2.0.xlsx -------------------------------------------------------------------------------- /benchmark/v2.1/results.v2.1.0.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/results.v2.1.0.xlsx -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a53_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a53_linear.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a53_linear_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a53_linear_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a53_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a53_log.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a53_log_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a53_log_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a72_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a72_linear.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a72_linear_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a72_linear_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a72_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a72_log.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_arm_a72_log_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_arm_a72_log_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_silvermont_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_silvermont_linear.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_silvermont_linear_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_silvermont_linear_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_silvermont_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_silvermont_log.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_silvermont_log_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_silvermont_log_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_skylake_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_skylake_linear.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_skylake_linear_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_skylake_linear_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_skylake_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_skylake_log.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.0_results_skylake_log_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.0_results_skylake_log_sm.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.3_results_threadripper_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.3_results_threadripper_linear.png -------------------------------------------------------------------------------- /benchmark/v2.1/v2.1.3_results_threadripper_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/benchmark/v2.1/v2.1.3_results_threadripper_log.png -------------------------------------------------------------------------------- /boostify/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: ned14 2 | -------------------------------------------------------------------------------- /boostify/build.jam: -------------------------------------------------------------------------------- 1 | # Copyright René Ferdinand Rivera Morell 2023-2024 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | require-b2 5.2 ; 7 | 8 | constant boost_dependencies : 9 | /boost/assert//boost_assert 10 | /boost/config//boost_config 11 | /boost/exception//boost_exception 12 | /boost/system//boost_system 13 | /boost/throw_exception//boost_throw_exception ; 14 | 15 | project /boost/outcome 16 | : common-requirements 17 | include 18 | ; 19 | 20 | explicit 21 | [ alias boost_outcome : : : : $(boost_dependencies) ] 22 | [ alias all : boost_outcome test ] 23 | ; 24 | 25 | call-if : boost-library outcome 26 | ; 27 | -------------------------------------------------------------------------------- /boostify/doc/Readme.md: -------------------------------------------------------------------------------- 1 | Note that the html documentation is generated from the Markdown in src by 2 | a Travis job on standalone https://github.com/ned14/outcome. 3 | 4 | Please send pull requests fixing documentation issues to 5 | https://github.com/ned14/outcome/pulls. 6 | -------------------------------------------------------------------------------- /boostify/doc/src/config.toml: -------------------------------------------------------------------------------- 1 | theme = "boostdoc" 2 | title = "Boost.Outcome documentation" 3 | publishDir = "../html" 4 | pygmentsStyle = "vs" 5 | pygmentsUseClasses = true 6 | PygmentsCodeFences = true 7 | enableGitInfo = true 8 | disableKinds = [ "RSS", "404" ] 9 | relativeURLs = true 10 | uglyURLs = true 11 | 12 | [outputs] 13 | home = [ "HTML" ] 14 | 15 | [params] 16 | snippetsURL = "https://github.com/boostorg/outcome/tree/master/doc/src/snippets/" 17 | editURL = "https://github.com/boostorg/outcome/edit/develop/doc/src/content/" 18 | -------------------------------------------------------------------------------- /boostify/meta/libraries.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "outcome", 3 | "name": "Outcome", 4 | "authors": [ "Niall Douglas" ], 5 | "maintainers": [ "Niall Douglas " ], 6 | "description": "A deterministic failure handling library partially simulating lightweight exceptions.", 7 | "std": [ "proposal" ], 8 | "category": [ 9 | "Patterns", 10 | "Emulation", 11 | "Programming" 12 | ], 13 | "cxxstd": "14" 14 | } 15 | -------------------------------------------------------------------------------- /cmake/interface.cmake: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT, GENERATED BY SCRIPT 2 | set(outcome_INTERFACE 3 | "include/outcome.hpp" 4 | "include/outcome/outcome.natvis" 5 | ) 6 | # DO NOT EDIT, GENERATED BY SCRIPT 7 | set(outcome_INTERFACE_SOURCE 8 | "include/outcome.ixx" 9 | ) 10 | -------------------------------------------------------------------------------- /cmake/toolchain-linux-libc++.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER clang-19) 2 | set(CMAKE_CXX_COMPILER clang++-19) 3 | set(CMAKE_CXX_STANDARD 20) 4 | set(CMAKE_CXX_FLAGS_INIT "-stdlib=libc++") 5 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-stdlib=libc++") 6 | set(CMAKE_MODULE_LINKER_FLAGS_INIT "-stdlib=libc++") 7 | set(CMAKE_SHARED_LINKER_FLAGS_INIT "-stdlib=libc++") 8 | 9 | -------------------------------------------------------------------------------- /conan/conanfile.py: -------------------------------------------------------------------------------- 1 | from conans import ConanFile, tools 2 | 3 | class OutcomeConan(ConanFile): 4 | name = "Outcome" 5 | version = "master" 6 | license = "Apache-2.0" 7 | description = "Provides very lightweight outcome and result" 8 | repo_url = "https://github.com/ned14/outcome" 9 | build_policy = "always" 10 | 11 | def source(self): 12 | file_url = "https://raw.githubusercontent.com/ned14/outcome/master/" 13 | tools.download(file_url + "single-header/outcome.hpp", filename="outcome.hpp") 14 | tools.download(file_url + "Licence.txt", filename="LICENCE") 15 | 16 | def package(self): 17 | self.copy("outcome.hpp", dst="include") 18 | self.copy("LICENCE", dst="licenses") 19 | 20 | def package_id(self): 21 | self.info.header_only() 22 | -------------------------------------------------------------------------------- /conan/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(OutcomePackageTest CXX) 2 | cmake_minimum_required(VERSION 3.1 FATAL_ERROR) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | set(CMAKE_CXX_EXTENSIONS OFF) 6 | 7 | include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) 8 | conan_basic_setup(TARGETS) 9 | 10 | add_executable(example example.cpp) 11 | target_link_libraries(example CONAN_PKG::Outcome) 12 | -------------------------------------------------------------------------------- /conan/test_package/example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace outcome = OUTCOME_V2_NAMESPACE; 4 | 5 | outcome::result test2(int x) 6 | { 7 | return x; 8 | } 9 | 10 | outcome::result test1(int x) 11 | { 12 | OUTCOME_TRY(test2(x)); 13 | return 0; 14 | } 15 | 16 | int main(void) 17 | { 18 | return test1(5).value(); 19 | } 20 | -------------------------------------------------------------------------------- /doc/presentations/20170429_ACCU 2017 Presentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/presentations/20170429_ACCU 2017 Presentation.pdf -------------------------------------------------------------------------------- /doc/presentations/20171110_Meeting C++ 2017 Presentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/presentations/20171110_Meeting C++ 2017 Presentation.pdf -------------------------------------------------------------------------------- /doc/presentations/20180917_CPPDUG 2018 Presentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/presentations/20180917_CPPDUG 2018 Presentation.pdf -------------------------------------------------------------------------------- /doc/presentations/videos.txt: -------------------------------------------------------------------------------- 1 | 20170429, ACCU, Mongrel Monads, Dirty, dirty, dirty 2 | Covers the history of error handling in C++, and how the LEWG Expected works. 3 | Slides: https://docs.google.com/presentation/d/1X_3VOxb8PMGXHBzjmzl5oVnwYVIyBpZHcY0Idv_9tSc/edit?usp=sharing 4 | Video: https://youtu.be/XVofgKH-uu4 5 | 6 | 20171110, Meeting C++, Introduction to proposed std::expected 7 | Literature review of the several WG21 papers relating to std::expected 8 | Slides: https://docs.google.com/presentation/d/1XTsnsGIV4HTh_07bjpCk_XG2NWDs6Tlrw8f5rrUHodc/edit?usp=sharing 9 | Video: https://www.youtube.com/watch?v=JfMBLx7qE0I 10 | 11 | 20180917, Dublin C++ users group, Deterministic Disappointment 12 | Literature review of the WG21 papers relating to deterministically handling failure, and using libraries such as Outcome to implement the same. 13 | Slides: https://docs.google.com/presentation/d/1fSkpD51FKmy8VEO9P86jWN6tOEaBmzHOXo14zLRkFKE/edit?usp=sharing 14 | Video: https://www.youtube.com/watch?v=cbUTAoHy6Ls 15 | -------------------------------------------------------------------------------- /doc/src/config.toml: -------------------------------------------------------------------------------- 1 | theme = "docdock" 2 | baseURL = "https://ned14.github.io/outcome/" 3 | title = "Outcome documentation" 4 | publishDir = "../html" 5 | pygmentsStyle = "vs" 6 | pygmentsUseClasses = true 7 | PygmentsCodeFences = true 8 | enableGitInfo = true 9 | 10 | [blackfriday] 11 | fractions = false 12 | 13 | [outputs] 14 | home = [ "HTML", "RSS", "JSON"] 15 | 16 | [params] 17 | snippetsURL = "https://github.com/ned14/outcome/tree/master/doc/src/snippets/" 18 | editURL = "https://github.com/ned14/outcome/edit/develop/doc/src/content/" 19 | 20 | [[menu.shortcuts]] 21 | pre = "

More

" 22 | name = " Outcome 2.2 github repo" 23 | identifier = "ds" 24 | url = "https://github.com/ned14/outcome" 25 | weight = 10 26 | 27 | [[menu.shortcuts]] 28 | name = " Acknowledgements" 29 | url = "/credits" 30 | weight = 30 31 | -------------------------------------------------------------------------------- /doc/src/content/_footer.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/src/content/_footer.md -------------------------------------------------------------------------------- /doc/src/content/_header.md: -------------------------------------------------------------------------------- 1 | Outcome 2.2 library documentation -------------------------------------------------------------------------------- /doc/src/content/alternatives/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Review of Error Handling Frameworks" 3 | weight = 8 4 | +++ 5 | 6 | Outcome [started life in 2014]({{% relref "/history" %}}), entered Boost as Boost.Outcome in 2018, and therefore was amongst the very first of the major alternative error handling frameworks to standard exception throws in C++. Since then, and sometimes in reaction to Outcome's choice of design, alternative frameworks have appeared. This page tries to give a fairly even handed summary of those alternatives, and how they compare to Outcome in this author's opinion. 7 | 8 | These are listed in order of approximate availability to the C++ ecosystem i.e. in order of appearance. 9 | 10 | {{% children description="true" depth="2" %}} 11 | 12 | My thanks to Emil Dotchevski for reviewing this summary and providing notes. 13 | -------------------------------------------------------------------------------- /doc/src/content/experimental/c-api/from-c/declare.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Declare a Result" 3 | description = "Declaring a C Result" 4 | weight = 20 5 | +++ 6 | 7 | {{% snippet "c_api2.cpp" "preamble" %}} 8 | 9 | The key to making C programming easy is to alias the long complex things 10 | into short easy thing. Obviously `SUCCESS(expr)` and `FAILURE(expr)` is too 11 | generic, but for the purposes of this documentation it makes thing easier. 12 | -------------------------------------------------------------------------------- /doc/src/content/experimental/c-api/from-c/try.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "TRY a C Result" 3 | description = "Operation TRY on a C Result" 4 | weight = 40 5 | +++ 6 | 7 | Thanks to much of the magic of {{< api "OUTCOME_TRY(var, expr)" >}} being implemented 8 | using C preprocessor metaprogramming, we can offer a very similar experience for the 9 | C try operation and without needing anything compiled in C++ as support functions: 10 | 11 | {{% snippet "c_api2.cpp" "try" %}} 12 | 13 | The principle difference is that you can specify a cleanup routine to perform if 14 | failure is encountered. This is especially useful in C, which has no stack unwinding. 15 | 16 | Also due to lack of type sugaring and user defined implicit conversions, if your 17 | callers result type isn't your callee's, you may need to specify what your caller's 18 | result type is so the error state can be correctly propagated. 19 | -------------------------------------------------------------------------------- /doc/src/content/experimental/c-api/from-c/use.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Using a Result" 3 | description = "Using a C Result" 4 | weight = 30 5 | +++ 6 | 7 | This models [the earlier C++ example of use]({{% relref "/experimental/worked-example/implicit-construction" %}}), 8 | and its C equivalent isn't much more verbose thanks to our helper typedefs and macros: 9 | 10 | {{% snippet "c_api2.cpp" "using" %}} 11 | 12 | For this to link, the `CXX_DECLARE_RESULT_SYSTEM_FROM_ENUM` macro needs to be 13 | compiled at least once within C++ within the final binary to emit the extern 14 | functions needed by C. 15 | -------------------------------------------------------------------------------- /doc/src/content/experimental/c-api/from-cxx/example.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Example C++ function" 3 | description = "" 4 | weight = 20 5 | +++ 6 | 7 | Let us start with a simple C++ function which we wish to make available to C code: 8 | 9 | {{% snippet "cpp_api.cpp" "function" %}} 10 | 11 | As the alias `status_result` defaults the erased type to the alias `system_code`, 12 | the `to_string()` function returns (in concrete types) `basic_result>>`. 13 | 14 | The standard Outcome function referenced is documented at 15 | {{% api "std::error_code error_from_exception(std::exception_ptr &&ep = std::current_exception(), std::error_code not_matched = std::make_error_code(std::errc::resource_unavailable_try_again)) noexcept" %}}. 16 | The proposed `` reference library implementation provides an identically named 17 | function taking similar parameters, but it returns a `outcome_e::system_code` (`status_code>`) instead of a `std::error_code`. 18 | 19 | -------------------------------------------------------------------------------- /doc/src/content/experimental/c-api/from-cxx/example2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Calling it from C" 3 | description = "" 4 | weight = 30 5 | +++ 6 | 7 | Firstly we need to declare to C our `result` returning C++ function: 8 | 9 | {{% snippet "c_api.c" "preamble" %}} 10 | 11 | Now let's call the C++ function from C: 12 | 13 | {{% snippet "c_api.c" "example" %}} 14 | 15 | Running this C program yields: 16 | 17 | ``` 18 | to_string(9) fills buffer with '9' of 1 characters 19 | to_string(99) fills buffer with '99' of 2 characters 20 | to_string(999) fills buffer with '999' of 3 characters 21 | to_string(9999) failed with error code 105 (No buffer space available) 22 | ``` 23 | -------------------------------------------------------------------------------- /doc/src/content/experimental/worked-example-long/implicit_conversion.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Implicit conversion" 3 | weight = 70 4 | +++ 5 | 6 | Back in [The payload]({{< relref "value_type" >}}), we 7 | mentioned that there was no default implicit conversion of `file_io_error` 8 | (`status_code<_file_io_error_domain>`) to `error`, as `error` is too small 9 | to hold `_file_io_error_domain::value_type`. 10 | 11 | We can tell the framework about available implicit conversions by defining 12 | an ADL discovered free function `make_status_code()` which takes our 13 | custom status code as input, and returns an `error`: 14 | 15 | {{% snippet "experimental_status_code.cpp" "implicit_conversion" %}} 16 | 17 | We are now ready to use Experimental Outcome! 18 | -------------------------------------------------------------------------------- /doc/src/content/experimental/worked-example-long/message.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Redefining `message()`" 3 | weight = 50 4 | +++ 5 | 6 | You may remember that our custom `_file_io_error_domain` inherits from 7 | `outcome_e::posix_code::domain_type`, and thus does not have to 8 | implement the many pure virtual functions required by `outcome_e::status_code_domain`. 9 | 10 | What we do need to do is reimplement `_do_message()` to append the 11 | file and line information to the POSIX error description string 12 | returned by `outcome_e::posix_code::domain_type`. This causes 13 | the status code's `.message()` observer to return a string 14 | with the extra payload information represented in text. 15 | 16 | {{% snippet "experimental_status_code.cpp" "message" %}} 17 | 18 | -------------------------------------------------------------------------------- /doc/src/content/experimental/worked-example-long/source.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Constexpr domain source" 3 | weight = 60 4 | +++ 5 | 6 | Back in [The constructor]({{< relref "constructor" >}}), we 7 | declared but did not implement a `.get()` function which returns a constexpr static 8 | instance of the domain. We implement this now: 9 | 10 | {{% snippet "experimental_status_code.cpp" "constexpr_source" %}} 11 | 12 | As this is 100% constexpr, it can be (and is under optimisation) implemented entirely 13 | in the mind of the compiler with no run time representation. 14 | -------------------------------------------------------------------------------- /doc/src/content/experimental/worked-example-long/value_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "The payload" 3 | weight = 20 4 | +++ 5 | 6 | We define the code domain's `value_type` -- the payload to be transported by 7 | status codes using this code domain -- to be a POSIX `errno` value, an integer 8 | line number and a const char pointer. 9 | 10 | {{% snippet "experimental_status_code.cpp" "value_type" %}} 11 | 12 | You will note that this is a `TriviallyCopyable` type, and so gains an implicit 13 | conversion to any `status_code>` where `sizeof(T) >= sizeof(value_type)`. 14 | 15 | `error` is however `status_code>`, and `sizeof(intptr_t) < sizeof(value_type)`, 16 | so it is not possible to implicitly convert status codes from this domain into 17 | `error`. Instead, you must tell the compiler how to do the conversion, as we 18 | shall see later. 19 | -------------------------------------------------------------------------------- /doc/src/content/experimental/worked-example/implicit-construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Implicit construction" 3 | weight = 10 4 | +++ 5 | 6 | The preceding code had the compiler stamp out a custom status code domain 7 | for a user supplied `enum`. You now get the following types: 8 | 9 | {{% snippet "quick_status_code_from_enum.cpp" "implicit_construction" %}} 10 | 11 | As you can see, this is less work than [plugging your custom enum 12 | into `std::error_code`]({{% relref "/motivation/plug_error_code" %}}). 13 | It also has C compatibility, and generates better codegen. 14 | -------------------------------------------------------------------------------- /doc/src/content/faq/results_arm_a53_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/src/content/faq/results_arm_a53_log.png -------------------------------------------------------------------------------- /doc/src/content/faq/results_arm_a72_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/src/content/faq/results_arm_a72_log.png -------------------------------------------------------------------------------- /doc/src/content/faq/results_silvermont_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/src/content/faq/results_silvermont_log.png -------------------------------------------------------------------------------- /doc/src/content/faq/results_skylake_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/src/content/faq/results_skylake_log.png -------------------------------------------------------------------------------- /doc/src/content/history/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/src/content/history/graph.png -------------------------------------------------------------------------------- /doc/src/content/motivation/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Motivation" 3 | weight = 8 4 | +++ 5 | 6 | This section describes techniques currently used to report and handle failures 7 | in functions, it also shows why these techniques might be insufficient. 8 | 9 | If you just want to learn how to use Outcome library go straight to [Tutorial 10 | section]({{% relref "/tutorial" %}}). 11 | 12 | {{% notice note %}} 13 | Motivation section of this documentation is not complete yet. 14 | {{% /notice %}} 15 | 16 | 17 | {{% children description="true" depth="1" %}} 18 | -------------------------------------------------------------------------------- /doc/src/content/recipes/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Recipes" 3 | weight = 12 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "API reference" 3 | weight = 20 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Aliases" 3 | weight = 60 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/boost_checked.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`boost_checked`" 3 | description = "A type alias to a `basic_result` configured with `boost::system::error_code` and `policy::throw_bad_result_access`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_result" %}} configured with `boost::system::error_code` and `policy::`{{% api "throw_bad_result_access" %}}. 7 | 8 | This type alias always references the `boost` edition of things, unlike {{% api "checked" %}} which references either this alias or {{% api "std_checked" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/boost_outcome.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`boost_outcome>`" 3 | description = "A type alias to a `basic_outcome` configured with `boost::system::error_code`, `boost::exception_ptr` and `policy::default_policy`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_outcome" %}} configured with {{% api "boost::system::error_code" %}}, {{% api "boost::exception_ptr" %}} and `policy::`{{% api "default_policy" %}}. 7 | 8 | This type alias always references the `std` edition of things, unlike {{% api "outcome>" %}} which references either this alias or {{% api "std_outcome>" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/boost_result.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`boost_result>`" 3 | description = "A type alias to a `basic_result` configured with `boost::system::error_code` and `policy::default_policy`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_result" %}} configured with `boost::system::error_code` and `policy::`{{% api "default_policy" %}}. 7 | 8 | This type alias always references the `boost` edition of things, unlike {{% api "result>" %}} which references either this alias or {{% api "std_result>" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/boost_unchecked.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`boost_unchecked`" 3 | description = "A type alias to a `basic_result` configured with `boost::system::error_code` and `policy::all_narrow`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_result" %}} configured with `boost::system::error_code` and `policy::`{{% api "all_narrow" %}}. 7 | 8 | This type alias always references the `boost` edition of things, unlike {{% api "unchecked" %}} which references either this alias or {{% api "std_unchecked" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/checked.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`checked`" 3 | description = "A type alias to a `std_checked` (standalone edition) or `boost_checked` (Boost edition)." 4 | +++ 5 | 6 | A type alias to either {{% api "std_checked" %}} (standalone edition) or {{% api "boost_checked" %}} (Boost edition). This means that `checked` uses the appropriate default alias depending on which edition of Outcome is in use. 7 | 8 | *Namespace*: `OUTCOME_V2_NAMESPACE` 9 | 10 | *Header*: `` 11 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/outcome.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`outcome>`" 3 | description = "A type alias to a `std_outcome` (standalone edition) or `boost_outcome` (Boost edition)." 4 | +++ 5 | 6 | A type alias to either {{% api "std_outcome>" %}} (standalone edition) or {{% api "boost_outcome>" %}} (Boost edition), and `policy::`{{% api "default_policy" %}}. This means that `outcome` uses the appropriate default alias depending on which edition of Outcome is in use. 7 | 8 | *Namespace*: `OUTCOME_V2_NAMESPACE` 9 | 10 | *Header*: `` 11 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/result.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`result>`" 3 | description = "A type alias to a `std_result` (standalone edition) or `boost_result` (Boost edition)." 4 | +++ 5 | 6 | A type alias to either {{% api "std_result>" %}} (standalone edition) or {{% api "boost_result>" %}} (Boost edition), and `policy::`{{% api "default_policy" %}}. This means that `result` uses the appropriate default alias depending on which edition of Outcome is in use. 7 | 8 | *Namespace*: `OUTCOME_V2_NAMESPACE` 9 | 10 | *Header*: `` 11 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/std_checked.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std_checked`" 3 | description = "A type alias to a `basic_result` configured with `std::error_code` and `policy::throw_bad_result_access`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_result" %}} configured with {{% api "std::error_code" %}} and `policy::`{{% api "throw_bad_result_access" %}}. 7 | 8 | This type alias always references the `std` edition of things, unlike {{% api "checked" %}} which references either this alias or {{% api "boost_checked" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/std_outcome.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std_outcome>`" 3 | description = "A type alias to a `basic_outcome` configured with `std::error_code`, `std::exception_ptr` and `policy::default_policy`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_outcome" %}} configured with {{% api "std::error_code" %}}, {{% api "std::exception_ptr" %}} and `policy::`{{% api "default_policy" %}}. 7 | 8 | This type alias always references the `std` edition of things, unlike {{% api "outcome>" %}} which references either this alias or {{% api "boost_outcome>" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/std_result.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std_result>`" 3 | description = "A type alias to a `basic_result` configured with `std::error_code` and `policy::default_policy`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_result" %}} configured with {{% api "std::error_code" %}} and `policy::`{{% api "default_policy" %}}. 7 | 8 | This type alias always references the `std` edition of things, unlike {{% api "result>" %}} which references either this alias or {{% api "boost_result>" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/std_unchecked.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std_unchecked`" 3 | description = "A type alias to a `basic_result` configured with `std::error_code` and `policy::all_narrow`." 4 | +++ 5 | 6 | A type alias to a {{% api "basic_result" %}} configured with {{% api "std::error_code" %}} and `policy::`{{% api "all_narrow" %}}. 7 | 8 | This type alias always references the `std` edition of things, unlike {{% api "unchecked" %}} which references either this alias or {{% api "boost_unchecked" %}}. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/aliases/unchecked.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`unchecked`" 3 | description = "A type alias to a `std_unchecked` (standalone edition) or `boost_unchecked` (Boost edition)." 4 | +++ 5 | 6 | A type alias to either {{% api "std_unchecked" %}} (standalone edition) or {{% api "boost_unchecked" %}} (Boost edition). This means that `unchecked` uses the appropriate default alias depending on which edition of Outcome is in use. 7 | 8 | *Namespace*: `OUTCOME_V2_NAMESPACE` 9 | 10 | *Header*: `` 11 | -------------------------------------------------------------------------------- /doc/src/content/reference/concepts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Concepts" 3 | weight = 20 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/converters/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Converters" 3 | weight = 25 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Functions" 3 | weight = 70 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Hooks" 3 | description = "Functions used to hook into the functionality of `basic_result` and `basic_outcome`." 4 | weight = 30 5 | +++ 6 | 7 | {{% children description="true" depth="2" %}} 8 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_outcome_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_outcome_construction(T *, U &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the implicit constructors of `basic_outcome`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_outcome_construction(T *, U &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the implicit constructors of `basic_outcome`. See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_outcome_construction2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_outcome_construction(T *, U &&, V &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the implicit constructors of `basic_outcome`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_outcome_construction(T *, U &&, V &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the implicit constructors of `basic_outcome` which consume two arguments. See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_outcome_copy_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_outcome_copy_construction(T *, U &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the converting copy constructors of `basic_outcome`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_outcome_copy_construction(T *, U &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting copy constructors of `basic_outcome` (NOT the standard copy constructor). See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_outcome_copy_construction2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_outcome_copy_construction(T *, U &&, V &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the converting copy constructors of `basic_outcome`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_outcome_copy_construction(T *, U &&, V &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting copy constructors of `basic_outcome` (NOT the standard copy constructor) which consume two arguments. See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_outcome_in_place_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_outcome_in_place_construction(T *, in_place_type_t, Args &&...) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the in-place constructors of `basic_outcome`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_outcome_in_place_construction(T *, in_place_type_t, Args &&...) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the in-place constructors of `basic_outcome`. See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_outcome_move_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_outcome_move_construction(T *, U &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the converting move constructors of `basic_outcome`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_outcome_move_construction(T *, U &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting move constructors of `basic_outcome` (NOT the standard move constructor). See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_outcome_move_construction2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_outcome_move_construction(T *, U &&, V &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the converting move constructors of `basic_outcome`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_outcome_move_construction(T *, U &&, V &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting move constructors of `basic_outcome` (NOT the standard move constructor) which consume two arguments. See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_result_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_result_construction(T *, U &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the implicit constructors of `basic_result`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_result_construction(T *, U &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the implicit constructors of `basic_result`. See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_result_copy_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_result_copy_construction(T *, U &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the converting copy constructors of `basic_result`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_result_copy_construction(T *, U &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the converting copy constructors of `basic_result` (NOT the standard copy constructor). See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_result_in_place_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_result_in_place_construction(T *, in_place_type_t, Args &&...) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the in-place constructors of `basic_result`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_result_in_place_construction(T *, in_place_type_t, Args &&...) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the in-place constructors of `basic_result`. See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/hook_result_move_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void hook_result_move_construction(T *, U &&) noexcept`" 3 | description = "(Until v2.2.0) ADL discovered free function hook invoked by the converting move constructors of `basic_result`." 4 | +++ 5 | 6 | Removed in Outcome v2.2.0, unless {{% api "OUTCOME_ENABLE_LEGACY_SUPPORT_FOR" %}} is set to less than `220` to 7 | enable emulation. Use {{% api "on_result_move_construction(T *, U &&) noexcept" %}} instead in new code. 8 | 9 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the converting move constructors of `basic_result` (NOT the standard move constructor). See each constructor's documentation to see which specific hook it invokes. 10 | 11 | *Overridable*: By Argument Dependent Lookup. 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/set_spare_storage.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void set_spare_storage(basic_result|basic_outcome *, uint16_t) noexcept`" 3 | description = "Sets the sixteen bits of spare storage in the specified result or outcome." 4 | +++ 5 | 6 | Sets the sixteen bits of spare storage in the specified result or outcome. You can retrieve these bits later using {{% api "uint16_t spare_storage(const basic_result|basic_outcome *) noexcept" %}}. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Requires*: Nothing. 11 | 12 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 13 | 14 | *Header*: `` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/hooks/spare_storage.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`uint16_t spare_storage(const basic_result|basic_outcome *) noexcept`" 3 | description = "Returns the sixteen bits of spare storage in the specified result or outcome." 4 | +++ 5 | 6 | Returns the sixteen bits of spare storage in the specified result or outcome. You can set these bits using {{% api "void set_spare_storage(basic_result|basic_outcome *, uint16_t) noexcept" %}}. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Requires*: Nothing. 11 | 12 | *Namespace*: `OUTCOME_V2_NAMESPACE::hooks` 13 | 14 | *Header*: `` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/iostream/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Iostream" 3 | description = "Functions used to print, serialise and deserialise `basic_result` and `basic_outcome`." 4 | weight = 35 5 | +++ 6 | 7 | {{% children description="true" depth="2" %}} 8 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/iostream/outcome_operator_in.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std::istream &operator>>(std::istream &, basic_outcome &)`" 3 | description = "Deserialises a `basic_outcome` from a `std::istream`." 4 | +++ 5 | 6 | Deserialises a `basic_outcome` from a `std::istream`. 7 | 8 | Serialisation format is: 9 | 10 | ``` 11 | 12 | ``` 13 | 14 | *Overridable*: Not overridable. 15 | 16 | *Requires*: That `operator>>` is a valid expression for `std::istream` and `T`, `EC` and `EP`. 17 | 18 | *Namespace*: `OUTCOME_V2_NAMESPACE` 19 | 20 | *Header*: `` (must be explicitly included manually). 21 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/iostream/outcome_operator_out.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std::ostream &operator<<(std::ostream &, const basic_outcome &)`" 3 | description = "Serialises a `basic_outcome` to a `std::ostream`." 4 | +++ 5 | 6 | Serialises a `basic_outcome` to a `std::ostream`. 7 | 8 | Serialisation format is: 9 | 10 | ``` 11 | 12 | ``` 13 | 14 | This is the **wrong** function to use if you wish to print human readable output. 15 | Use {{% api "std::string print(const basic_outcome &)" %}} instead. 16 | 17 | *Overridable*: Not overridable. 18 | 19 | *Requires*: That `operator<<` is a valid expression for `std::ostream` and `T`, `EC` and `EP`. 20 | 21 | *Namespace*: `OUTCOME_V2_NAMESPACE` 22 | 23 | *Header*: `` (must be explicitly included manually). 24 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/iostream/outcome_print.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std::string print(const basic_outcome &)`" 3 | description = "Returns a string containing a human readable rendition of the `basic_outcome`." 4 | +++ 5 | 6 | Returns a string containing a human readable rendition of the `basic_outcome`. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Requires*: Always available. 11 | 12 | *Namespace*: `OUTCOME_V2_NAMESPACE` 13 | 14 | *Header*: `` (must be explicitly included manually). 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/iostream/result_operator_in.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std::istream &operator>>(std::istream &, basic_result &)`" 3 | description = "Deserialises a `basic_result` from a `std::istream`." 4 | +++ 5 | 6 | Deserialises a `basic_result` from a `std::istream`. 7 | 8 | Serialisation format is: 9 | 10 | ``` 11 | 12 | ``` 13 | 14 | *Overridable*: Not overridable. 15 | 16 | *Requires*: That `operator>>` is a valid expression for `std::istream` and `T` and `E`. 17 | 18 | *Namespace*: `OUTCOME_V2_NAMESPACE` 19 | 20 | *Header*: `` (must be explicitly included manually). 21 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/iostream/result_operator_out.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std::ostream &operator<<(std::ostream &, const basic_result &)`" 3 | description = "Serialises a `basic_result` to a `std::ostream`." 4 | +++ 5 | 6 | Serialises a `basic_result` to a `std::ostream`. 7 | 8 | Serialisation format is: 9 | 10 | ``` 11 | 12 | ``` 13 | 14 | This is the **wrong** function to use if you wish to print human readable output. 15 | Use {{% api "std::string print(const basic_result &)" %}} instead. 16 | 17 | *Overridable*: Not overridable. 18 | 19 | *Requires*: That `operator<<` is a valid expression for `std::ostream` and `T` and `E`. 20 | 21 | *Namespace*: `OUTCOME_V2_NAMESPACE` 22 | 23 | *Header*: `` (must be explicitly included manually). 24 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/iostream/result_print.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`std::string print(const basic_result &)`" 3 | description = "Returns a string containing a human readable rendition of the `basic_result`." 4 | +++ 5 | 6 | Returns a string containing a human readable rendition of the `basic_result`. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Requires*: Always available. 11 | 12 | *Namespace*: `OUTCOME_V2_NAMESPACE` 13 | 14 | *Header*: `` (must be explicitly included manually). 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/policy/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Policy" 3 | description = "Functions used to customise how the policy classes operate." 4 | weight = 40 5 | +++ 6 | 7 | {{% children description="true" depth="2" %}} 8 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/policy/basic_outcome_failure_exception_from_error.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`auto basic_outcome_failure_exception_from_error(const EC &)`" 3 | description = "ADL discovered free function synthesising an exception type from an error type, used by the `.failure()` observers." 4 | +++ 5 | 6 | Synthesises an exception type from an error type, used by the {{% api "exception_type failure() const noexcept" %}} 7 | observers. ADL discovered. Default 8 | overloads for this function are defined in Outcome for {{% api "std::error_code" %}} 9 | and `boost::system::error_code`, these return `std::make_exception_ptr(std::system_error(ec))` 10 | and `boost::copy_exception(boost::system::system_error(ec))` respectively. 11 | 12 | *Overridable*: Argument dependent lookup. 13 | 14 | *Requires*: Nothing. 15 | 16 | *Namespace*: Namespace of `EC` type. 17 | 18 | *Header*: ``, `` 19 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/policy/error_code.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`decltype(auto) error_code(T &&)`" 3 | description = "Extracts a `boost::system::error_code` or `std::error_code` from the input via ADL discovery of a suitable `make_error_code(T)` function." 4 | +++ 5 | 6 | Extracts a `boost::system::error_code` or {{% api "std::error_code" %}} from the input via ADL discovery of a suitable `make_error_code(T)` function. 7 | 8 | *Overridable*: Argument dependent lookup. 9 | 10 | *Requires*: Always available. 11 | 12 | *Namespace*: `OUTCOME_V2_NAMESPACE::policy` 13 | 14 | *Header*: `` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/policy/exception_ptr.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`decltype(auto) exception_ptr(T &&)`" 3 | description = "Extracts a `boost::exception_ptr` or `std::exception_ptr` from the input via ADL discovery of a suitable `make_exception_ptr(T)` function." 4 | +++ 5 | 6 | Extracts a `boost::exception_ptr` or {{% api "std::exception_ptr" %}} from the input via ADL discovery of a suitable `make_exception_ptr(T)` function. 7 | 8 | *Overridable*: Argument dependent lookup. 9 | 10 | *Requires*: Always available. 11 | 12 | *Namespace*: `OUTCOME_V2_NAMESPACE::policy` 13 | 14 | *Header*: `` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/policy/outcome_throw_as_system_error_with_payload_boost_error_code.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void outcome_throw_as_system_error_with_payload(const boost::system::error_code &)`" 3 | description = "Specialisation of `outcome_throw_as_system_error_with_payload()` for `boost::system::error_code`." 4 | +++ 5 | 6 | A specialisation of `outcome_throw_as_system_error_with_payload()` for `boost::system::error_code`. This executes {{% api "OUTCOME_THROW_EXCEPTION(expr)" %}} with a `boost::system::system_error` constructed from the input. 7 | 8 | *Overridable*: Argument dependent lookup. 9 | 10 | *Requires*: Nothing. 11 | 12 | *Namespace*: `boost::system` 13 | 14 | *Header*: `` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/policy/outcome_throw_as_system_error_with_payload_std_error_code.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`void outcome_throw_as_system_error_with_payload(const std::error_code &)`" 3 | description = "Specialisation of `outcome_throw_as_system_error_with_payload()` for `std::error_code`." 4 | +++ 5 | 6 | A specialisation of `outcome_throw_as_system_error_with_payload()` for `std::error_code`. This executes {{% api "OUTCOME_THROW_EXCEPTION(expr)" %}} with a {{% api "std::system_error" %}} constructed from the input. 7 | 8 | *Overridable*: Argument dependent lookup. 9 | 10 | *Requires*: Nothing. 11 | 12 | *Namespace*: `std` 13 | 14 | *Header*: `` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/success.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`auto success(T &&, ...)`" 3 | description = "Returns appropriate type sugar for constructing a successful result or outcome." 4 | +++ 5 | 6 | Returns appropriate type sugar for constructing a successful result or outcome, usually {{% api "success_type" %}} with a decayed `T`. 7 | 8 | Two default overloads are provided, one taking a single required parameter with optional spare storage value parameter returning `success_type>` and perfectly forwarding the input. The other overload takes no parameters, and returns `success_type`, which usually causes the construction of the receiving `basic_result` or `basic_outcome`'s with a default construction of their value type. 9 | 10 | *Overridable*: By Argument Dependent Lookup (ADL). 11 | 12 | *Requires*: Always available. 13 | 14 | *Namespace*: `OUTCOME_V2_NAMESPACE` 15 | 16 | *Header*: `` 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/try_operation_extract_value.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`decltype(auto) try_operation_extract_value(X)`" 3 | description = "Default implementation of `try_operation_extract_value(X)` ADL customisation point for `OUTCOME_TRY`." 4 | +++ 5 | 6 | This default implementation returns whatever the `.assume_value()` or `.value()` member functions return, preferentially choosing the former where both are available. 7 | 8 | *Requires*: That the expression `std::declval().assume_value()` and/or `std::declval().value()` is a valid expression. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/try_operation_has_value.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool try_operation_has_value(X)`" 3 | description = "Default implementation of `try_operation_has_value(X)` ADL customisation point for `OUTCOME_TRY`." 4 | +++ 5 | 6 | This default implementation returns whatever the `.has_value()` member function returns. 7 | 8 | *Requires*: That the expression `std::declval().has_value()` is a valid expression. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/functions/try_operation_return_as.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`decltype(auto) try_operation_return_as(X)`" 3 | description = "Default implementation of `try_operation_return_as(X)` ADL customisation point for `OUTCOME_TRY`." 4 | +++ 5 | 6 | This default implementation preferentially returns whatever the input type's `.as_failure()` member function returns. 7 | `basic_result` and `basic_outcome` provide such a member function, see {{% api "auto as_failure() const &" %}}. 8 | 9 | If `.as_failure()` is not available, it will also match any `.error()` member function, which it wraps into a failure type sugar using {{% api "failure(T &&, ...)" %}}. 10 | 11 | *Requires*: That the expression `std::declval().as_failure()` and/or `std::declval().error()` is a valid expression. 12 | 13 | *Namespace*: `OUTCOME_V2_NAMESPACE` 14 | 15 | *Header*: `` 16 | -------------------------------------------------------------------------------- /doc/src/content/reference/macros/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Macros" 3 | weight = 10 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/macros/disable_execinfo.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_DISABLE_EXECINFO`" 3 | description = "If defined, disables the use of the `` header (or the win32 emulation)." 4 | +++ 5 | 6 | If defined, disables the use of the `` header (or the win32 emulation). 7 | 8 | Some embedded Linux toolchains do not define ``, thus disabling C++ exceptions on those toolchains produces a failure to find this file. Avoid that problem by defining this macro to disable stack backtrace support entirely. 9 | 10 | *Overridable*: Define before inclusion. 11 | 12 | *Default*: Defined if `__ANDROID__` is defined, else undefined. 13 | 14 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/enable_legacy_support_for.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_ENABLE_LEGACY_SUPPORT_FOR`" 3 | description = "Enables backwards features and naming compatibility for earlier versions of Outcome." 4 | +++ 5 | 6 | As Outcome has evolved, some features and especially naming were retired in newer versions. Define this macro to enable backwards compatibility aliasing from old features and naming to new features and naming. 7 | 8 | *Overridable*: Define before inclusion. 9 | 10 | *Default*: The current version of Outcome, expressed in hundreds e.g. Outcome v2.10 is `210`. 11 | 12 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/in_place_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_USE_STD_IN_PLACE_TYPE`" 3 | description = "How to implement `in_place_type_t` and `in_place_type`." 4 | +++ 5 | 6 | How to implement {{% api "in_place_type_t" %}} and `in_place_type`. 7 | 8 | If set to `1`, the `` header is included, and `std::in_place_type_t` 9 | is aliased into `OUTCOME_V2_NAMESPACE::in_place_type_t` along with 10 | `std::in_place_type`. 11 | 12 | If set to `0`, a local emulation is used. 13 | 14 | *Overridable*: Define before inclusion. 15 | 16 | *Default*: If the current compiler implements C++ 17 or later, if unset 17 | this macro is defaulted to `1`, otherwise it is defaulted to `0`. 18 | 19 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/is_nothrow_swappable.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE`" 3 | description = "How to implement `is_nothrow_swappable`." 4 | +++ 5 | 6 | Whether to implement `is_nothrow_swappable` as `std::is_nothrow_swappable`, 7 | or else use a local emulation. 8 | 9 | *Overridable*: Define before inclusion. 10 | 11 | *Default*: If the current compiler implements C++ 17 or later, if unset 12 | this macro is defaulted to `1`, otherwise it is defaulted to `0`. 13 | 14 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/nodiscard.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_NODISCARD`" 3 | description = "How to tell the compiler than the return value of a function should not be discarded without examining it." 4 | +++ 5 | 6 | Compiler-specific markup used to tell the compiler than the return value of a function should not be discarded without examining it. 7 | 8 | *Overridable*: Define before inclusion. 9 | 10 | *Default*: To `[[nodiscard]]` if on C++ 17 or higher, `__attribute__((warn_unused_result))` if on clang, SAL `_Must_inspect_result_` if on MSVC, otherwise nothing. 11 | 12 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/requires.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_REQUIRES(...)`" 3 | description = "A C++ 20 `requires(...)`, if available." 4 | +++ 5 | 6 | A C++ 20 `requires(...)`, if available. 7 | 8 | *Overridable*: Define before inclusion. 9 | 10 | *Default*: To `requires(...)` if on C++ 20 or later, else to nothing. 11 | 12 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/symbol_visible.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_SYMBOL_VISIBLE`" 3 | description = "How to mark throwable types as always having default ELF symbol visibility." 4 | +++ 5 | 6 | Compiler-specific markup used to mark throwable types as always having default ELF symbol visibility, without which it will be impossible to catch throws of such types across shared library boundaries on ELF only. 7 | 8 | *Overridable*: Define before inclusion. 9 | 10 | *Default*:
11 |
Standalone Outcome: 12 |
To `__attribute__((visibility("default"))` on GCC and clang when targeting ELF, otherwise nothing. 13 |
Boost.Outcome: 14 |
To `BOOST_SYMBOL_VISIBLE`. 15 |
16 | 17 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/thread_local.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_THREAD_LOCAL`" 3 | description = "How to mark variables as having thread local storage duration." 4 | +++ 5 | 6 | Compiler-specific markup used to mark variables as having thread local storage duration. 7 | 8 | {{% notice note %}} 9 | This isn't used inside Outcome, but is used by its unit test suite. 10 | {{% /notice %}} 11 | 12 | *Overridable*: Define before inclusion. 13 | 14 | *Default*: To `thread_local` if the compiler implements C++ 11 `thread_local`, else `__thread` for the one supported compiler (older Mac OS XCode) which does not. 15 | 16 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/macros/throw_exception.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`OUTCOME_THROW_EXCEPTION(expr)`" 3 | description = "How to throw a C++ exception, or equivalent thereof." 4 | +++ 5 | 6 | Throws a C++ exception, or equivalent thereof. 7 | 8 | *Overridable*: Define before inclusion. 9 | 10 | *Default*:
11 |
Standalone Outcome (C++ exceptions enabled): 12 |
To `throw expr` 13 |
Standalone Outcome (C++ exceptions disabled): 14 |
To `OUTCOME_V2_NAMESPACE::detail::do_fatal_exit(#expr)` which is a function which prints a useful error message including a stack backtrace (where available) to `stderr` before calling `abort()`. 15 |
Boost.Outcome: 16 |
To `BOOST_THROW_EXCEPTION(expr)`. 17 |
18 | 19 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/policies/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Policies" 3 | weight = 40 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/all_narrow.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`all_narrow`" 3 | description = "Policy class defining that hard undefined behaviour should occur on incorrect narrow and wide value, error or exception observation. Inherits publicly from `base`." 4 | +++ 5 | 6 | Policy class defining that hard undefined behaviour should occur on incorrect narrow and wide value, error or exception observation. 7 | 8 | Inherits publicly from {{% api "base" %}}, and simply defines its wide value, error and exception observer policies to call their corresponding narrow editions. 9 | 10 | Included by ``, and so is always available when `basic_result` is available. 11 | 12 | *Requires*: Nothing. 13 | 14 | *Namespace*: `OUTCOME_V2_NAMESPACE::policy` 15 | 16 | *Header*: `` 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`base`" 3 | description = "Base class of most policy classes defining the narrow observer policies." 4 | +++ 5 | 6 | Implements the base class of most policy classes defining the narrow observer policies. 7 | 8 | *Requires*: Nothing. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE::policy` 11 | 12 | *Header*: `` 13 | 14 | ### Protected member functions 15 | 16 | #### Special 17 | 18 | {{% children description="true" depth="2" categories="special" %}} 19 | 20 | #### Observers 21 | 22 | {{% children description="true" depth="2" categories="observers" %}} 23 | 24 | #### Modifiers 25 | 26 | {{% children description="true" depth="2" categories="modifiers" %}} 27 | 28 | ### Public member functions 29 | 30 | {{% children description="true" depth="2" categories="observer-policies" %}} 31 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/error.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static auto &&_error(Impl &&) noexcept`" 3 | description = "Returns a reference to the error in the implementation passed in. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 260 6 | +++ 7 | 8 | Returns a reference to the error in the implementation passed in. No checking is done to ensure there is an error. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/exception.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static auto &&_exception(Impl &&) noexcept`" 3 | description = "Returns a reference to the exception in the implementation passed in. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 270 6 | +++ 7 | 8 | Returns a reference to the exception in the implementation passed in. No checking is done to ensure there is an error. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/has_error.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static bool _has_error(Impl &&) noexcept`" 3 | description = "Returns true if an error is present in the implementation passed in. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 210 6 | +++ 7 | 8 | Returns true if an error is present in the implementation passed in. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/has_error_is_errno.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static bool _has_error_is_errno(Impl &&) noexcept`" 3 | description = "Returns true if the error code in the implementation passed in has a domain or category matching that of POSIX `errno`. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 240 6 | +++ 7 | 8 | Returns true if the error code in the implementation passed in has a domain or category matching that of POSIX `errno`. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/has_exception.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static bool _has_exception(Impl &&) noexcept`" 3 | description = "Returns true if an exception is present in the implementation passed in. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 230 6 | +++ 7 | 8 | Returns true if an exception is present in the implementation passed in. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/has_value.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static bool _has_value(Impl &&) noexcept`" 3 | description = "Returns true if a value is present in the implementation passed in. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 200 6 | +++ 7 | 8 | Returns true if a value is present in the implementation passed in. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/narrow_error_check.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void narrow_error_check(Impl &&) noexcept`" 3 | description = "Observer policy performing hard UB if no error is present. Constexpr, never throws." 4 | categories = ["observer-policies"] 5 | weight = 410 6 | +++ 7 | 8 | Observer policy performing hard UB if no error is present, by calling {{% api "static void _ub(Impl &&)" %}}. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/narrow_exception_check.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void narrow_exception_check(Impl &&) noexcept`" 3 | description = "Observer policy performing hard UB if no exception is present. Constexpr, never throws." 4 | categories = ["observer-policies"] 5 | weight = 420 6 | +++ 7 | 8 | Observer policy performing hard UB if no exception is present, by calling {{% api "static void _ub(Impl &&)" %}}. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/narrow_value_check.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void narrow_value_check(Impl &&) noexcept`" 3 | description = "Observer policy performing hard UB if no value is present. Constexpr, never throws." 4 | categories = ["observer-policies"] 5 | weight = 400 6 | +++ 7 | 8 | Observer policy performing hard UB if no value is present, by calling {{% api "static void _ub(Impl &&)" %}}. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_outcome_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_outcome_construction(T *, U &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the implicit constructors of `basic_outcome`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the implicit constructors of `basic_outcome`. See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_outcome_construction2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_outcome_construction(T *, U &&, V &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the implicit constructors of `basic_outcome`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the implicit constructors of `basic_outcome` which consume two arguments. See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_outcome_copy_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_outcome_copy_construction(T *, U &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the converting copy constructors of `basic_outcome`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting copy constructors of `basic_outcome` (NOT the standard copy constructor). See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_outcome_copy_construction2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_outcome_copy_construction(T *, U &&, V &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the converting copy constructors of `basic_outcome`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting copy constructors of `basic_outcome` (NOT the standard copy constructor) which consume two arguments. See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_outcome_in_place_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_outcome_in_place_construction(T *, in_place_type_t, Args &&...) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the in-place constructors of `basic_outcome`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the in-place constructors of `basic_outcome`. See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_outcome_move_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_outcome_move_construction(T *, U &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the converting move constructors of `basic_outcome`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting move constructors of `basic_outcome` (NOT the standard move constructor). See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_outcome_move_construction2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_outcome_move_construction(T *, U &&, V &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the converting move constructors of `basic_outcome`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_outcome" %}}, generally invoked by the converting move constructors of `basic_outcome` (NOT the standard move constructor) which consume two arguments. See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_result_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_result_construction(T *, U &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the implicit constructors of `basic_result`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the implicit constructors of `basic_result`. See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_result_copy_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_result_copy_construction(T *, U &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the converting copy constructors of `basic_result`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the converting copy constructors of `basic_result` (NOT the standard copy constructor). See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_result_in_place_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_result_in_place_construction(T *, in_place_type_t, Args &&...) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the in-place constructors of `basic_result`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the in-place constructors of `basic_result`. See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/on_result_move_construction.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void on_result_move_construction(T *, U &&) noexcept`" 3 | description = "(>= Outcome v2.2.0) Hook invoked by the converting move constructors of `basic_result`." 4 | categories = ["observer-policies"] 5 | weight = 450 6 | +++ 7 | 8 | One of the constructor hooks for {{% api "basic_result" %}}, generally invoked by the converting move constructors of `basic_result` (NOT the standard move constructor). See each constructor's documentation to see which specific hook it invokes. 9 | 10 | *Requires*: Always available. 11 | 12 | *Guarantees*: Never throws an exception. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/set_has_error.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void _set_has_error(Impl &&, bool) noexcept`" 3 | description = "Sets whether the implementation has an error. Constexpr, never throws." 4 | categories = ["modifiers"] 5 | weight = 310 6 | +++ 7 | 8 | Sets whether the implementation has an error by setting or clearing the relevant bit in the flags. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/set_has_error_is_errno.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void _set_has_exception(Impl &&, bool) noexcept`" 3 | description = "Sets whether the implementation's error code has a domain or category matching that of POSIX `errno`. Constexpr, never throws." 4 | categories = ["modifiers"] 5 | weight = 340 6 | +++ 7 | 8 | Sets whether the implementation's error code has a domain or category matching that of POSIX `errno` by setting or clearing the relevant bit in the flags. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/set_has_exception.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void _set_has_exception(Impl &&, bool) noexcept`" 3 | description = "Sets whether the implementation has an exception. Constexpr, never throws." 4 | categories = ["modifiers"] 5 | weight = 330 6 | +++ 7 | 8 | Sets whether the implementation has an exception by setting or clearing the relevant bit in the flags. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/set_has_value.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static void _set_has_value(Impl &&, bool) noexcept`" 3 | description = "Sets whether the implementation has a value. Constexpr, never throws." 4 | categories = ["modifiers"] 5 | weight = 300 6 | +++ 7 | 8 | Sets whether the implementation has a value by setting or clearing the relevant bit in the flags. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/base/value.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`static auto &&_value(Impl &&) noexcept`" 3 | description = "Returns a reference to the value in the implementation passed in. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 250 6 | +++ 7 | 8 | Returns a reference to the value in the implementation passed in. No checking is done to ensure there is a value. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/policies/terminate.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`terminate`" 3 | description = "Policy class defining that `std::terminate()` should be called on incorrect wide value, error or exception observation. Inherits publicly from `base`." 4 | +++ 5 | 6 | Policy class defining that {{% api "std::terminate()" %}} should be called on incorrect wide value, error or exception observation. 7 | 8 | Inherits publicly from {{% api "base" %}}, and its narrow value, error and exception observer policies are inherited from there. 9 | 10 | Included by ``, and so is always available when `basic_result` is available. 11 | 12 | *Requires*: Nothing. 13 | 14 | *Namespace*: `OUTCOME_V2_NAMESPACE::policy` 15 | 16 | *Header*: `` 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Traits" 3 | weight = 30 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/is_basic_outcome.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`is_basic_outcome`" 3 | description = "An integral constant type true for `basic_outcome` types." 4 | +++ 5 | 6 | An integral constant type true for {{% api "basic_outcome" %}} types. This does not match anything not exactly a `basic_outcome`. If you want to match types like `basic_outcome` but not equal to it, consider {{% api "basic_outcome" %}}.. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | 14 | *Variable alias*: `is_basic_outcome_v` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/is_basic_result.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`is_basic_result`" 3 | description = "An integral constant type true for `basic_result` types." 4 | +++ 5 | 6 | An integral constant type true for {{% api "basic_result" %}} types. This does not match anything not exactly a `basic_result`. If you want to match types like `basic_result` but not equal to it, consider {{% api "basic_result" %}} or {{% api "value_or_error" %}}. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | 14 | *Variable alias*: `is_basic_result_v` 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/is_error_code_available.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`is_error_code_available`" 3 | description = "True if an error code can be constructed from a `T`." 4 | +++ 5 | 6 | `::value` is true if an error code can be constructed from a `T` e.g. if there exists an ADL discovered free function `make_error_code(T)`. 7 | `::type` is the type that would result if `::value` is true, else `void`. 8 | 9 | *Overridable*: By template specialisation into the `trait` namespace. 10 | 11 | *Default*: True if `T` is an error code, else to metaprogramming which performs the ADL discovery of `make_error_code(T)`. Note that the STL defines multiple overloads of an ADL discovered free function {{% api "std::make_error_code(T)" %}} for its error enumerations, as does Boost.System for the Boost error enumerations. Thus this trait will pick up those free functions for those error types. 12 | 13 | *Namespace*: `OUTCOME_V2_NAMESPACE::trait` 14 | 15 | *Header*: `` 16 | 17 | *Variable alias*: `is_error_code_available_v` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/is_error_type_enum.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`is_error_type_enum`" 3 | description = "A customisable integral constant type true for `E` types constructible from `Enum` types which are to receive error throwing no-value policies." 4 | +++ 5 | 6 | A customisable integral constant type true for `E` types constructible from `Enum` types which are to receive error throwing no-value policies 7 | 8 | *Overridable*: By template specialisation into the `trait` namespace. 9 | 10 | *Default*: False. Specialisations exist for: 11 | 12 | - `` 13 | - `boost::system::error_code` to `boost::system::is_error_condition_enum::value`. 14 | 15 | - `` 16 | - `std::error_code` to `std::is_error_condition_enum::value`. 17 | 18 | *Namespace*: `OUTCOME_V2_NAMESPACE::trait` 19 | 20 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/traits/is_exception_ptr_available.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`is_exception_ptr_available`" 3 | description = "True if an exception ptr can be constructed from a `T`." 4 | +++ 5 | 6 | `::value` is true if an exception ptr can be constructed from a `T` e.g. if there exists an ADL discovered free function `make_exception_ptr(T)`. 7 | `::type` is the type that would result if `::value` is true, else `void`. 8 | 9 | *Overridable*: By template specialisation into the `trait` namespace. 10 | 11 | *Default*: True if `T` is an exception ptr, else to metaprogramming which performs the ADL discovery of `make_exception_ptr(T)`. Note that the STL defines an ADL discovered free function {{% api "std::make_exception_ptr(T)" %}}. Thus this trait will pick up that free function. 12 | 13 | *Namespace*: `OUTCOME_V2_NAMESPACE::trait` 14 | 15 | *Header*: `` 16 | 17 | *Variable alias*: `is_exception_ptr_available_v` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/is_failure_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`is_failure_type`" 3 | description = "An integral constant boolean variable true for `failure_type` types." 4 | +++ 5 | 6 | An integral constant boolean variable true for {{% api "failure_type" %}} types. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/is_success_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`is_success_type`" 3 | description = "An integral constant boolean variable true for `success_type` types." 4 | +++ 5 | 6 | An integral constant boolean variable true for {{% api "success_type" %}} types. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Namespace*: `OUTCOME_V2_NAMESPACE` 11 | 12 | *Header*: `` 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/traits/type_can_be_used_in_basic_result.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`type_can_be_used_in_basic_result`" 3 | description = "A constexpr boolean true for types permissible in `basic_result`." 4 | +++ 5 | 6 | A constexpr boolean true for types permissible in `basic_result`. 7 | 8 | *Overridable*: Not overridable. 9 | 10 | *Definition*: True for a type which: 11 | 12 | - Is not a reference. 13 | - Is not an {{% api "in_place_type_t" %}}. 14 | - Is not a {{% api "success_type" %}}. 15 | - Is not a {{% api "failure_type" %}}. 16 | - Is not an array. 17 | - Is either `void`, or else is an `Object` and is `Destructible`. 18 | 19 | *Namespace*: `OUTCOME_V2_NAMESPACE::trait` 20 | 21 | *Header*: `` -------------------------------------------------------------------------------- /doc/src/content/reference/types/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Types" 3 | weight = 50 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/bad_outcome_access.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bad_outcome_access`" 3 | description = "Exception type publicly inheriting from `std::logic_error` indicating an incorrect observation of value or error or exception occurred." 4 | +++ 5 | 6 | Exception type publicly inheriting from {{% api "std::logic_error" %}} indicating an incorrect observation of value or error or exception occurred by {{% api "basic_outcome" %}}. 7 | 8 | No member functions are added in addition to `std::logic_error`. Typical `.what()` strings are: 9 | 10 | - `"no value"` 11 | - `"no error"` 12 | - `"no exception"` 13 | 14 | *Requires*: Nothing. 15 | 16 | *Namespace*: `OUTCOME_V2_NAMESPACE` 17 | 18 | *Header*: `` 19 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/bad_result_access.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bad_result_access`" 3 | description = "Exception type publicly inheriting from `std::logic_error` indicating an incorrect observation of value or error occurred." 4 | +++ 5 | 6 | Exception type publicly inheriting from {{% api "std::logic_error" %}} indicating an incorrect observation of value or error occurred by {{% api "basic_result" %}}. 7 | 8 | No member functions are added in addition to `std::logic_error`. Typical `.what()` strings are: 9 | 10 | - `"no value"` 11 | - `"no error"` 12 | 13 | *Requires*: Nothing. 14 | 15 | *Namespace*: `OUTCOME_V2_NAMESPACE` 16 | 17 | *Header*: `` 18 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/as_failure_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`failure_type as_failure() const &`" 3 | description = "Return the output from free function `failure()` containing a copy of any errored and/or excepted state." 4 | categories = ["observers"] 5 | weight = 910 6 | +++ 7 | 8 | Return the output from free function {{% api "auto failure(T &&, ...)" %}} containing a copy of any errored and/or excepted state. The error and/or exception state is accessed using {{% api "const error_type &assume_error() const & noexcept" %}} and {{% api "const exception_type &assume_exception() const & noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Whatever that of `error_type`'s and/or `exception_type`'s copy constructor is. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/as_failure_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`failure_type as_failure() &&`" 3 | description = "Return the output from free function `failure()` containing a move of any errored and/or excepted state." 4 | categories = ["modifiers"] 5 | weight = 920 6 | +++ 7 | 8 | Return the output from free function {{% api "auto failure(T &&, ...)" %}} containing a move from any errored and/or excepted state, thus leaving the outcome's error and exception values in a moved-from state. Depending on the choice of `error_type` and/or `exception_type`, this function may therefore be destructive. The error and exception states are accessed using {{% api "error_type &&assume_error() && noexcept" %}} and {{% api "exception_type &&assume_exception() && noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Whatever that of `error_type`'s and/or `exception_type`'s move constructor is. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_error_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &assume_error() & noexcept`" 3 | description = "Narrow contract lvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 700 6 | +++ 7 | 8 | Narrow contract lvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_error_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &assume_error() const & noexcept`" 3 | description = "Narrow contract const lvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 710 6 | +++ 7 | 8 | Narrow contract const lvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_error_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &&assume_error() && noexcept`" 3 | description = "Narrow contract rvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 720 6 | +++ 7 | 8 | Narrow contract rvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_error_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &&assume_error() const && noexcept`" 3 | description = "Narrow contract const rvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 730 6 | +++ 7 | 8 | Narrow contract const rvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_exception_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`exception_type &assume_exception() & noexcept`" 3 | description = "Narrow contract lvalue reference observer of the stored exception. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 780 6 | +++ 7 | 8 | Narrow contract lvalue reference observer of the stored exception. `NoValuePolicy::narrow_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_exception_check()` does that. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_exception_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const exception_type &assume_exception() const & noexcept`" 3 | description = "Narrow contract const lvalue reference observer of the stored exception. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 781 6 | +++ 7 | 8 | Narrow contract const lvalue reference observer of the stored exception. `NoValuePolicy::narrow_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_exception_check()` does that. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_exception_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`exception_type &&assume_exception() && noexcept`" 3 | description = "Narrow contract rvalue reference observer of the stored exception. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 782 6 | +++ 7 | 8 | Narrow contract rvalue reference observer of the stored exception. `NoValuePolicy::narrow_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_exception_check()` does that. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_exception_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const exception_type &&assume_exception() const && noexcept`" 3 | description = "Narrow contract const rvalue reference observer of the stored exception. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 782 6 | +++ 7 | 8 | Narrow contract const rvalue reference observer of the stored exception. `NoValuePolicy::narrow_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_exception_check()` does that. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_value_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &assume_value() & noexcept`" 3 | description = "Narrow contract lvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 600 6 | +++ 7 | 8 | Narrow contract lvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_value_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &assume_value() const & noexcept`" 3 | description = "Narrow contract const lvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 610 6 | +++ 7 | 8 | Narrow contract const lvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_value_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &&assume_value() && noexcept`" 3 | description = "Narrow contract rvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 620 6 | +++ 7 | 8 | Narrow contract rvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/assume_value_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &&assume_value() const && noexcept`" 3 | description = "Narrow contract const rvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 630 6 | +++ 7 | 8 | Narrow contract const rvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/copy_assignment.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome &operator=(const basic_outcome &)`" 3 | description = "Copy assignment. Constexpr, triviality and noexcept propagating." 4 | categories = ["operators", "assignment", "copy-assignment"] 5 | weight = 140 6 | +++ 7 | 8 | Copy assignment. 9 | 10 | *Requires*: that `value_type`, `error_type` and `exception_type` all implement copy assignment. 11 | 12 | *Complexity*: If the `value_type` for both is present, uses `value_type`'s copy assignment operator, else either destructs or copy constructs `value_type` as appropriate. `error_type`'s and `exception_type`'s copy assignment operator is always used. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/copy_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(const basic_outcome &)`" 3 | description = "Copy constructor. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "copy-constructors"] 5 | weight = 120 6 | +++ 7 | 8 | Copy constructor. 9 | 10 | *Requires*: that `value_type`, `error_type` and `exception_type` all implement a copy constructor. 11 | 12 | *Complexity*: Same as for `value_type`'s, `error_type`'s and `exception_type`'s copy constructors. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome() = delete`" 3 | description = "The default constructor (disabled)." 4 | categories = ["constructors", "implicit-constructors", "default-constructors"] 5 | weight = 100 6 | +++ 7 | 8 | The default constructor for basic outcome is always disabled. 9 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/destructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`~basic_outcome()`" 3 | description = "Destructor. Constexpr, triviality and noexcept propagating." 4 | categories = ["destructors"] 5 | weight = 150 6 | +++ 7 | 8 | Destructor. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Same as for `value_type`'s, `error_type`'s and `exception_type`'s destructors. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/disabling_catchall.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(Args...) = delete`" 3 | description = "Disabling catchall constructor used to give useful diagnostic error when trying to use non-inplace constructors when `predicate::constructors_enabled` is false." 4 | categories = ["constructors", "disabling-constructors"] 5 | weight = 160 6 | +++ 7 | 8 | Disabling catchall constructor used to give useful diagnostic error when trying to use non-inplace constructors when `predicate::constructors_enabled` is false. 9 | 10 | *Requires*: `predicate::constructors_enabled` is false. 11 | 12 | *Complexity*: N/A. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/disabling_implicit_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(X &&) = delete`" 3 | description = "Disabling implicit constructor used to give useful diagnostic error when trying to use implicit constructors when `predicate::implicit_constructors_enabled` is false." 4 | categories = ["constructors", "disabling-constructors"] 5 | weight = 170 6 | +++ 7 | 8 | Disabling implicit constructor used to give useful diagnostic error when trying to use implicit constructors when `predicate::implicit_constructors_enabled` is false. 9 | 10 | *Requires*: `predicate::implicit_constructors_enabled` is false. 11 | 12 | *Complexity*: N/A. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/equality_basic_outcome.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator==(const basic_outcome &) const`" 3 | description = "Returns true if this outcome compares equal to the other outcome. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 801 6 | +++ 7 | 8 | Returns true if this outcome compares equal to the other outcome. Comparison is done using `operator==` on `value_type` or `error_type` and/or `exception_type` if the currently chosen state is the same for both outcomes, otherwise false is returned. 9 | 10 | *Requires*: `operator==` must be a valid expression between `value_type` and `A`, and between `error_type` and `B`, and between `exception_type` and `C`. If `value_type` is `void`, then so must be `A`; similarly for `error_type` and `B`; similarly for `exception_type` and `C`. 11 | 12 | *Complexity*: Whatever the underlying `operator==` have. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/equality_basic_result.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator==(const basic_result &) const`" 3 | description = "Returns true if this outcome compares equal to the other result. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 800 6 | +++ 7 | 8 | Returns true if this outcome compares equal to the other result. Comparison is done using `operator==` on `value_type` or `error_type` if the currently chosen state is the same for both outcome and result, otherwise false is returned. Note that if the outcome is excepted, it will never compare equal to a result. 9 | 10 | *Requires*: `operator==` must be a valid expression between `value_type` and `A`, and between `error_type` and `B`. If `value_type` is `void`, then so must be `A`; similarly for `error_type` and `B`. 11 | 12 | *Complexity*: Whatever the underlying `operator==` have. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/equality_failure_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator==(const failure_type &) const`" 3 | description = "Returns true if this outcome compares equal to the failure type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 820 6 | +++ 7 | 8 | Returns true if this outcome is unsuccessful and its error compares equal to the error in the failure type sugar. Comparison is done using `operator==` on `error_type` and `A` and on `exception_type` and `B`. 9 | 10 | *Requires*: `operator==` must be a valid expression between `error_type` and `A`, or `A` is `void`; `operator==` must be a valid expression between `exception_type` and `B`, or `B` is `void`. If `error_type` is `void`, then so must be `A`; if `exception_type` is `void`, then so must be `B`. 11 | 12 | *Complexity*: Whatever the underlying `operator==` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/equality_success_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator!=(const success_type &) const`" 3 | description = "Returns true if this outcome does not compare equal to the success type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 850 6 | +++ 7 | 8 | Returns true if this outcome is not successful or its value does not compares equal to the value in the success type sugar. Comparison is done using `operator!=` on `value_type` and `A`. If `A` is `void`, this call aliases {{% api "bool has_error() const noexcept" %}}. 9 | 10 | *Requires*: `operator!=` must be a valid expression between `value_type` and `A`, or `A` is `void`. If `value_type` is `void`, then so must be `A`. 11 | 12 | *Complexity*: Whatever the underlying `operator!=` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/error_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &error() &`" 3 | description = "Wide contract lvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 740 6 | +++ 7 | 8 | Wide contract lvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/error_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &error() const &`" 3 | description = "Wide contract const lvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 750 6 | +++ 7 | 8 | Wide contract const lvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/error_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &&error() &&`" 3 | description = "Wide contract rvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 760 6 | +++ 7 | 8 | Wide contract rvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/error_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &&error() const &&`" 3 | description = "Wide contract const rvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 770 6 | +++ 7 | 8 | Wide contract const rvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/exception_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`exception_type &exception() &`" 3 | description = "Wide contract lvalue reference observer of the stored exception. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 785 6 | +++ 7 | 8 | Wide contract lvalue reference observer of the stored exception. `NoValuePolicy::wide_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs if `NoValuePolicy::wide_exception_check()` returns. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_exception_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/exception_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const exception_type &exception() const &`" 3 | description = "Wide contract const lvalue reference observer of the stored exception. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 786 6 | +++ 7 | 8 | Wide contract const lvalue reference observer of the stored exception. `NoValuePolicy::wide_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs if `NoValuePolicy::wide_exception_check()` returns. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_exception_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/exception_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`exception_type &&exception() &&`" 3 | description = "Wide contract rvalue reference observer of the stored exception. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 787 6 | +++ 7 | 8 | Wide contract rvalue reference observer of the stored exception. `NoValuePolicy::wide_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs if `NoValuePolicy::wide_exception_check()` returns. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_exception_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/exception_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const exception_type &&exception() const &&`" 3 | description = "Wide contract const rvalue reference observer of the stored exception. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 788 6 | +++ 7 | 8 | Wide contract const rvalue reference observer of the stored exception. `NoValuePolicy::wide_exception_check()` is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs if `NoValuePolicy::wide_exception_check()` returns. 9 | 10 | Note that if `exception_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_exception_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/explicit_inplace_error_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`explicit basic_outcome(in_place_type_t, Args ...)`" 3 | description = "Explicit inplace error constructor. Available if `predicate::enable_inplace_error_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "explicit-constructors", "inplace-constructors"] 5 | weight = 420 6 | +++ 7 | 8 | Explicit inplace error constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t, Args &&...) noexcept" %}} with `this`, `in_place_type` and `Args ...`. 9 | 10 | *Requires*: `predicate::enable_inplace_error_constructor` is true. 11 | 12 | *Complexity*: Same as for the `error_type` constructor which accepts `Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/explicit_inplace_value_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`explicit basic_outcome(in_place_type_t, Args ...)`" 3 | description = "Explicit inplace value constructor. Available if `predicate::enable_inplace_value_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "explicit-constructors", "inplace-constructors"] 5 | weight = 400 6 | +++ 7 | 8 | Explicit inplace value constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t, Args &&...) noexcept" %}} with `this`, `in_place_type` and `Args ...`. 9 | 10 | *Requires*: `predicate::enable_inplace_value_constructor` is true. 11 | 12 | *Complexity*: Same as for the `value_type` constructor which accepts `Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/has_error.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_error() const noexcept`" 3 | description = "Returns true if an error is present. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 592 6 | +++ 7 | 8 | Returns true if an error is present. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/has_exception.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_exception() const noexcept`" 3 | description = "Returns true if an exception is present. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 593 6 | +++ 7 | 8 | Returns true if an exception is present. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/has_failure.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_failure() const noexcept`" 3 | description = "Returns true if there is either an error or an exception. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 595 6 | +++ 7 | 8 | Returns true if there is either an error or an exception. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/has_value.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_value() const noexcept`" 3 | description = "Returns true if a value is present. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 591 6 | +++ 7 | 8 | Returns true if a value is present. Constexpr where possible. Alias for {{% api "explicit operator bool() const noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_error_condition_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(ErrorCondEnum &&)`" 3 | description = "Implicit `error_type` from `ErrorCondEnum` constructor. Available if `predicate::enable_error_condition_converting_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 200 6 | +++ 7 | 8 | Implicit `error_type` from `ErrorCondEnum` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `ErrorCondEnum`. 9 | 10 | *Requires*: `predicate::enable_error_condition_converting_constructor` is true. 11 | 12 | *Complexity*: Same as for `error_type`'s copy or move constructor from the result of `make_error_code(ErrorCondEnum)`. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the state of the input is left indeterminate. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_error_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(S &&)`" 3 | description = "Implicit `error_type` constructor. Available if `predicate::enable_error_converting_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 190 6 | +++ 7 | 8 | Implicit `error_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `S`. 9 | 10 | *Requires*: `predicate::enable_error_converting_constructor` is true. 11 | 12 | *Complexity*: Same as for `error_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_error_exception_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(S &&, P &&)`" 3 | description = "Implicit `error_type` + `exception_type` constructor. Available if `predicate::enable_error_exception_converting_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 202 6 | +++ 7 | 8 | Implicit `error_type` + `exception_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&, V &&) noexcept" %}} with `this`, `S` and `P`. 9 | 10 | *Requires*: `predicate::enable_error_exception_converting_constructor` is true. 11 | 12 | *Complexity*: Same as for `error_type`'s and `exception_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_exception_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(P &&)`" 3 | description = "Implicit `exception_type` constructor. Available if `predicate::enable_exception_converting_constructor

` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 201 6 | +++ 7 | 8 | Implicit `exception_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `P`. 9 | 10 | *Requires*: `predicate::enable_exception_converting_constructor

` is true. 11 | 12 | *Complexity*: Same as for `exception_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_failure_error_copy_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(const failure_type &)`" 3 | description = "Implicit error-from-failure-type-sugar copy constructor. Available if `predicate::enable_compatible_conversion` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "tagged-constructors"] 5 | weight = 520 6 | +++ 7 | 8 | Implicit error-from-failure-type-sugar copy constructor used to disambiguate the construction of the error type. 9 | Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and `const failure_type &`. 10 | 11 | *Requires*: `predicate::enable_compatible_conversion` is true. 12 | 13 | *Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_failure_error_exception_move_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(failure_type &&)`" 3 | description = "Implicit error-and-exception-from-failure-type-sugar move constructor. Available if `predicate::enable_compatible_conversion` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "tagged-constructors"] 5 | weight = 537 6 | +++ 7 | 8 | Implicit error-and-exception-from-failure-type-sugar move constructor used to disambiguate the construction of the error + exception types. 9 | Calls {{% api "void on_outcome_move_construction(T *, U &&, V &&) noexcept" %}} with `this`, `failure_type &&` and `failure_type &&`. 10 | 11 | *Requires*: `predicate::enable_compatible_conversion` is true. 12 | 13 | *Complexity*: Same as for the `error_type` and `exception_type` constructors which accept `EC` and `EP`. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_failure_error_make_error_code_copy_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(const failure_type &)`" 3 | description = "Implicit error-from-failure-type-sugar copy constructor. Available if `predicate::enable_make_error_code_compatible_conversion` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "tagged-constructors"] 5 | weight = 531 6 | +++ 7 | 8 | Implicit error-from-failure-type-sugar copy constructor used to disambiguate the construction of the error type. 9 | Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and `const failure_type &`. 10 | 11 | *Requires*: `predicate::enable_make_error_code_compatible_conversion` is true. 12 | 13 | *Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_failure_error_make_error_code_move_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(failure_type &&)`" 3 | description = "Implicit error-from-failure-type-sugar move constructor. Available if `predicate::enable_make_error_code_compatible_conversion` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "tagged-constructors"] 5 | weight = 532 6 | +++ 7 | 8 | Implicit error-from-failure-type-sugar move constructor used to disambiguate the construction of the error type. 9 | Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and `failure_type &&`. 10 | 11 | *Requires*: `predicate::enable_make_error_code_compatible_conversion` is true. 12 | 13 | *Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_failure_error_move_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(failure_type &&)`" 3 | description = "Implicit error-from-failure-type-sugar move constructor. Available if `predicate::enable_compatible_conversion` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "tagged-constructors"] 5 | weight = 530 6 | +++ 7 | 8 | Implicit error-from-failure-type-sugar move constructor used to disambiguate the construction of the error type. 9 | Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and `failure_type &&`. 10 | 11 | *Requires*: `predicate::enable_compatible_conversion` is true. 12 | 13 | *Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_failure_exception_copy_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(const failure_type &)`" 3 | description = "Implicit exception-from-failure-type-sugar copy constructor. Available if `predicate::enable_compatible_conversion` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "tagged-constructors"] 5 | weight = 534 6 | +++ 7 | 8 | Implicit exception-from-failure-type-sugar copy constructor used to disambiguate the construction of the exception type. 9 | Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and `const failure_type &`. 10 | 11 | *Requires*: `predicate::enable_compatible_conversion` is true. 12 | 13 | *Complexity*: Same as for the `exception_type` constructor which accepts `EP`. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_failure_exception_move_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(failure_type &&)`" 3 | description = "Implicit exception-from-failure-type-sugar move constructor. Available if `predicate::enable_compatible_conversion` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "tagged-constructors"] 5 | weight = 535 6 | +++ 7 | 8 | Implicit exception-from-failure-type-sugar move constructor used to disambiguate the construction of the exception type. 9 | Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and `failure_type &&`. 10 | 11 | *Requires*: `predicate::enable_compatible_conversion` is true. 12 | 13 | *Complexity*: Same as for the `exception_type` constructor which accepts `EP`. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/implicit_value_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(R &&)`" 3 | description = "Implicit `value_type` constructor. Available if `predicate::enable_value_converting_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 180 6 | +++ 7 | 8 | Implicit `value_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `R`. 9 | 10 | *Requires*: `predicate::enable_value_converting_constructor` is true. 11 | 12 | *Complexity*: Same as for `value_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/inequality_basic_outcome.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator!=(const basic_outcome &) const`" 3 | description = "Returns true if this outcome does not compare equal to the other outcome. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 846 6 | +++ 7 | 8 | Returns true if this outcome does not compare equal to the other outcome. Comparison is done using `operator!=` on `value_type`, `error_type` and/or `exception_type` if the currently chosen state is the same for both outcomes, otherwise true is returned. 9 | 10 | *Requires*: `operator!=` must be a valid expression between `value_type` and `A`, and between `error_type` and `B`, and between `exception_type` and `C`. If `value_type` is `void`, then so must be `A`; similarly for `error_type` and `B`; similarly for `exception_type` and `C`. 11 | 12 | *Complexity*: Whatever the underlying `operator!=` have. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/inequality_basic_result.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator!=(const basic_result &) const`" 3 | description = "Returns true if this outcome does not compare equal to the other result. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 845 6 | +++ 7 | 8 | Returns true if this outcome does not compare equal to the other result. Comparison is done using `operator!=` on `value_type` or `error_type` if the currently chosen state is the same for both outcome and result, otherwise true is returned. Note that an excepted outcome is always unequal to a result. 9 | 10 | *Requires*: `operator!=` must be a valid expression between `value_type` and `A`, and between `error_type` and `B`. If `value_type` is `void`, then so must be `A`; similarly for `error_type` and `B`. 11 | 12 | *Complexity*: Whatever the underlying `operator!=` have. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/inequality_failure_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator!=(const failure_type &) const`" 3 | description = "Returns true if this outcome does not compare equal to the failure type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 860 6 | +++ 7 | 8 | Returns true if this outcome is successful or its error or exception does not compare equal to the error in the failure type sugar. Comparison is done using `operator!=` on `error_type` and `A` and on `exception_type` and `B`. 9 | 10 | *Requires*: `operator!=` must be a valid expression between `error_type` and `A`, or `A` is `void`; `operator!=` must be a valid expression between `exception_type` and `B`, or `B` is `void`. If `error_type` is `void`, then so must be `A`; if `exception_type` is `void`, then so must be `B`. 11 | 12 | *Complexity*: Whatever the underlying `operator!=` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/inequality_success_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator==(const success_type &) const`" 3 | description = "Returns true if this result compares equal to the success type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 810 6 | +++ 7 | 8 | Returns true if this result is successful and its value compares equal to the value in the success type sugar. Comparison is done using `operator==` on `value_type` and `A`. If `A` is `void`, this call aliases {{% api "bool has_value() const noexcept" %}}. 9 | 10 | *Requires*: `operator==` must be a valid expression between `value_type` and `A`, or `A` is `void`. If `value_type` is `void`, then so must be `A`. 11 | 12 | *Complexity*: Whatever the underlying `operator==` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/move_assignment.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome &operator=(basic_outcome &&)`" 3 | description = "Move assignment. Constexpr, triviality and noexcept propagating." 4 | categories = ["operators", "assignment", "move-assignment"] 5 | weight = 130 6 | +++ 7 | 8 | Move assignment. 9 | 10 | *Requires*: that `value_type`, `error_type` and `exception_type` all implement move assignment. 11 | 12 | *Complexity*: If the `value_type` for both is present, uses `value_type`'s move assignment operator, else either destructs or move constructs `value_type` as appropriate. `error_type`'s and `exception_type`'s move assignment operator are always used. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/move_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_outcome(basic_outcome &&)`" 3 | description = "Move constructor. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "move-constructors"] 5 | weight = 110 6 | +++ 7 | 8 | Move constructor. 9 | 10 | *Requires*: that `value_type`, `error_type` and `exception_type` all implement a move constructor. 11 | 12 | *Complexity*: Same as for `value_type`'s, `error_type`'s and `exception_type`'s move constructors. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/operator_bool.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`explicit operator bool() const noexcept`" 3 | description = "Returns true if a value is present. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 590 6 | +++ 7 | 8 | Returns true if a value is present. Constexpr where possible. Alias for {{% api "bool has_value() const noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/value_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &value() &`" 3 | description = "Wide contract lvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 640 6 | +++ 7 | 8 | Wide contract lvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/value_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &value() const &`" 3 | description = "Wide contract const lvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 650 6 | +++ 7 | 8 | Wide contract const lvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/value_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &&value() &&`" 3 | description = "Wide contract rvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 660 6 | +++ 7 | 8 | Wide contract rvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_outcome/value_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &&value() const &&`" 3 | description = "Wide contract const rvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 670 6 | +++ 7 | 8 | Wide contract const rvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/as_failure_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`auto as_failure() const &`" 3 | description = "Return the output from free function `failure()` containing a copy of any errored state." 4 | categories = ["observers"] 5 | weight = 910 6 | +++ 7 | 8 | Return the output from free function {{% api "auto failure(T &&, ...)" %}} containing a copy of any errored state. The error state is accessed using {{% api "const error_type &assume_error() const & noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Whatever that of `error_type`'s copy constructor is. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/as_failure_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`auto as_failure() &&`" 3 | description = "Return the output from free function `failure()` containing a move of any errored state." 4 | categories = ["modifiers"] 5 | weight = 920 6 | +++ 7 | 8 | Return the output from free function {{% api "auto failure(T &&, ...)" %}} containing a move from any errored state, thus leaving the result's error value in a moved-from state. Depending on the choice of `error_type`, this function may therefore be destructive. The error state is accessed using {{% api "error_type &&assume_error() && noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Whatever that of `error_type`'s move constructor is. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_error_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &assume_error() & noexcept`" 3 | description = "Narrow contract lvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 700 6 | +++ 7 | 8 | Narrow contract lvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_error_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &assume_error() const & noexcept`" 3 | description = "Narrow contract const lvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 710 6 | +++ 7 | 8 | Narrow contract const lvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_error_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &&assume_error() && noexcept`" 3 | description = "Narrow contract rvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 720 6 | +++ 7 | 8 | Narrow contract rvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_error_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &&assume_error() const && noexcept`" 3 | description = "Narrow contract const rvalue reference observer of the stored error. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 730 6 | +++ 7 | 8 | Narrow contract const rvalue reference observer of the stored error. `NoValuePolicy::narrow_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs unless `NoValuePolicy::narrow_error_check()` does that. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_error_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_value_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &assume_value() & noexcept`" 3 | description = "Narrow contract lvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 600 6 | +++ 7 | 8 | Narrow contract lvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_value_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &assume_value() const & noexcept`" 3 | description = "Narrow contract const lvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 610 6 | +++ 7 | 8 | Narrow contract const lvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_value_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &&assume_value() && noexcept`" 3 | description = "Narrow contract rvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 620 6 | +++ 7 | 8 | Narrow contract rvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/assume_value_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &&assume_value() const && noexcept`" 3 | description = "Narrow contract const rvalue reference observer of any value present. Constexpr propagating, never throws." 4 | categories = ["observers"] 5 | weight = 630 6 | +++ 7 | 8 | Narrow contract const rvalue reference observer of any value present. `NoValuePolicy::narrow_value_check()` is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however `NoValuePolicy::narrow_value_check()` can do something to avoid that. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::narrow_value_check()`. 15 | 16 | *Guarantees*: An exception is never thrown. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/copy_assignment.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result &operator=(const basic_result &)`" 3 | description = "Copy assignment. Constexpr, triviality and noexcept propagating." 4 | categories = ["operators", "assignment", "copy-assignment"] 5 | weight = 140 6 | +++ 7 | 8 | Copy assignment. 9 | 10 | *Requires*: that `value_type` and `error_type` both implement copy assignment. 11 | 12 | *Complexity*: If the `value_type` for both is present, uses `value_type`'s copy assignment operator, else either destructs or copy constructs `value_type` as appropriate. `error_type`'s copy assignment operator is always used. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/copy_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(const basic_result &)`" 3 | description = "Copy constructor. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "copy-constructors"] 5 | weight = 120 6 | +++ 7 | 8 | Copy constructor. 9 | 10 | *Requires*: that `value_type` and `error_type` both implement a copy constructor. 11 | 12 | *Complexity*: Same as for `value_type`'s and `error_type`'s copy constructors. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result() = delete`" 3 | description = "The default constructor (disabled)." 4 | categories = ["constructors", "implicit-constructors", "default-constructors"] 5 | weight = 100 6 | +++ 7 | 8 | The default constructor for basic result is always disabled. 9 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/destructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`~basic_result()`" 3 | description = "Destructor. Constexpr, triviality and noexcept propagating." 4 | categories = ["destructors"] 5 | weight = 150 6 | +++ 7 | 8 | Destructor. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Same as for `value_type`'s and `error_type`'s destructors. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/disabling_catchall.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(Args...) = delete`" 3 | description = "Disabling catchall constructor used to give useful diagnostic error when trying to use non-inplace constructors when `predicate::constructors_enabled` is false." 4 | categories = ["constructors", "disabling-constructors"] 5 | weight = 160 6 | +++ 7 | 8 | Disabling catchall constructor used to give useful diagnostic error when trying to use non-inplace constructors when `predicate::constructors_enabled` is false. 9 | 10 | *Requires*: `predicate::constructors_enabled` is false. 11 | 12 | *Complexity*: N/A. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/disabling_implicit_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(X &&) = delete`" 3 | description = "Disabling implicit constructor used to give useful diagnostic error when trying to use implicit constructors when `predicate::implicit_constructors_enabled` is false." 4 | categories = ["constructors", "disabling-constructors"] 5 | weight = 170 6 | +++ 7 | 8 | Disabling implicit constructor used to give useful diagnostic error when trying to use implicit constructors when `predicate::implicit_constructors_enabled` is false. 9 | 10 | *Requires*: `predicate::implicit_constructors_enabled` is false. 11 | 12 | *Complexity*: N/A. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/equality_failure_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator==(const failure_type &) const`" 3 | description = "Returns true if this result compares equal to the failure type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 820 6 | +++ 7 | 8 | Returns true if this result is unsuccessful and its error compares equal to the error in the failure type sugar. Comparison is done using `operator==` on `error_type` and `A`. If `A` is `void`, this call aliases {{% api "bool has_error() const noexcept" %}}. 9 | 10 | *Requires*: `operator==` must be a valid expression between `error_type` and `A`, or `A` is `void`. If `error_type` is `void`, then so must be `A`. 11 | 12 | *Complexity*: Whatever the underlying `operator==` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/equality_success_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator!=(const success_type &) const`" 3 | description = "Returns true if this result does not compare equal to the success type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 850 6 | +++ 7 | 8 | Returns true if this result is not successful or its value does not compares equal to the value in the success type sugar. Comparison is done using `operator!=` on `value_type` and `A`. If `A` is `void`, this call aliases {{% api "bool has_error() const noexcept" %}}. 9 | 10 | *Requires*: `operator!=` must be a valid expression between `value_type` and `A`, or `A` is `void`. If `value_type` is `void`, then so must be `A`. 11 | 12 | *Complexity*: Whatever the underlying `operator!=` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/error_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &error() &`" 3 | description = "Wide contract lvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 740 6 | +++ 7 | 8 | Wide contract lvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/error_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &error() const &`" 3 | description = "Wide contract const lvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 750 6 | +++ 7 | 8 | Wide contract const lvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/error_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`error_type &&error() &&`" 3 | description = "Wide contract rvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 760 6 | +++ 7 | 8 | Wide contract rvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/error_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const error_type &&error() const &&`" 3 | description = "Wide contract const rvalue reference observer of the stored error. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 770 6 | +++ 7 | 8 | Wide contract const rvalue reference observer of the stored error. `NoValuePolicy::wide_error_check()` is first invoked, then the reference to the error is returned. As a valid default constructed error is always present, no undefined behaviour occurs if `NoValuePolicy::wide_error_check()` returns. 9 | 10 | Note that if `error_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_error_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/explicit_inplace_error_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`explicit basic_result(in_place_type_t, Args ...)`" 3 | description = "Explicit inplace error constructor. Available if `predicate::enable_inplace_error_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "explicit-constructors", "inplace-constructors"] 5 | weight = 420 6 | +++ 7 | 8 | Explicit inplace error constructor. Calls {{% api "void on_result_in_place_construction(T *, in_place_type_t, Args &&...) noexcept" %}} with `this`, `in_place_type` and `Args ...`. 9 | 10 | *Requires*: `predicate::enable_inplace_error_constructor` is true. 11 | 12 | *Complexity*: Same as for the `error_type` constructor which accepts `Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/explicit_inplace_value_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`explicit basic_result(in_place_type_t, Args ...)`" 3 | description = "Explicit inplace value constructor. Available if `predicate::enable_inplace_value_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "explicit-constructors", "inplace-constructors"] 5 | weight = 400 6 | +++ 7 | 8 | Explicit inplace value constructor. Calls {{% api "void on_result_in_place_construction(T *, in_place_type_t, Args &&...) noexcept" %}} with `this`, `in_place_type` and `Args ...`. 9 | 10 | *Requires*: `predicate::enable_inplace_value_constructor` is true. 11 | 12 | *Complexity*: Same as for the `value_type` constructor which accepts `Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/has_error.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_error() const noexcept`" 3 | description = "Returns true if an error is present. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 592 6 | +++ 7 | 8 | Returns true if an error is present. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/has_exception.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_exception() const noexcept`" 3 | description = "Always returns false for `basic_result`. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 593 6 | +++ 7 | 8 | Always returns false for `basic_result`. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/has_failure.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_failure() const noexcept`" 3 | description = "Returns true if there is either an error or an exception. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 595 6 | +++ 7 | 8 | Returns true if there is either an error or an exception. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/has_lost_consistency.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_lost_consistency() const noexcept`" 3 | description = "Returns true if a preceding swap involving this object failed to preserve the strong guarantee. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 596 6 | +++ 7 | 8 | Returns true if a preceding swap involving this object failed to preserve the strong guarantee. Constexpr where possible. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/has_value.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool has_value() const noexcept`" 3 | description = "Returns true if a value is present. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 591 6 | +++ 7 | 8 | Returns true if a value is present. Constexpr where possible. Alias for {{% api "explicit operator bool() const noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/implicit_error_condition_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(ErrorCondEnum &&)`" 3 | description = "Implicit `error_type` from `ErrorCondEnum` constructor. Available if `predicate::enable_error_condition_converting_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 200 6 | +++ 7 | 8 | Implicit `error_type` from `ErrorCondEnum` constructor. Calls {{% api "void on_result_construction(T *, U &&) noexcept" %}} with `this` and `ErrorCondEnum`. 9 | 10 | *Requires*: `predicate::enable_error_condition_converting_constructor` is true. 11 | 12 | *Complexity*: Same as for `error_type`'s copy or move constructor from the result of `make_error_code(ErrorCondEnum)`. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the state of the input is left indeterminate. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/implicit_error_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(S &&)`" 3 | description = "Implicit `error_type` constructor. Available if `predicate::enable_error_converting_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 190 6 | +++ 7 | 8 | Implicit `error_type` constructor. Calls {{% api "void on_result_construction(T *, U &&) noexcept" %}} with `this` and `S`. 9 | 10 | *Requires*: `predicate::enable_error_converting_constructor` is true. 11 | 12 | *Complexity*: Same as for `error_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/implicit_inplace_value_error_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(A1 &&, A2 &&, Args ...)`" 3 | description = "Implicit inplace value or error constructor. Available if `predicate::enable_inplace_value_error_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "inplace-constructors"] 5 | weight = 440 6 | +++ 7 | 8 | Implicit inplace value or error constructor. Delegates to an appropriate explicit inplace constructor depending on input. 9 | 10 | *Requires*: predicate::enable_inplace_value_error_constructor` is true. 11 | 12 | *Complexity*: Same as for the `value_type` or `error_type` constructor which accepts `A1, A2, Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/implicit_value_converting_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(R &&)`" 3 | description = "Implicit `value_type` constructor. Available if `predicate::enable_value_converting_constructor` is true. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "converting-constructors"] 5 | weight = 180 6 | +++ 7 | 8 | Implicit `value_type` constructor. Calls {{% api "void on_result_construction(T *, U &&) noexcept" %}} with `this` and `R`. 9 | 10 | *Requires*: `predicate::enable_value_converting_constructor` is true. 11 | 12 | *Complexity*: Same as for `value_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/inequality_failure_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator!=(const failure_type &) const`" 3 | description = "Returns true if this result does not compare equal to the failure type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 860 6 | +++ 7 | 8 | Returns true if this result is successful or its error does not compare equal to the error in the failure type sugar. Comparison is done using `operator!=` on `error_type` and `A`. If `A` is `void`, this call aliases {{% api "bool has_value() const noexcept" %}}. 9 | 10 | *Requires*: `operator!=` must be a valid expression between `error_type` and `A`, or `A` is `void`. If `error_type` is `void`, then so must be `A`. 11 | 12 | *Complexity*: Whatever the underlying `operator!=` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/inequality_success_type.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`bool operator==(const success_type &) const`" 3 | description = "Returns true if this result compares equal to the success type sugar. Constexpr and noexcept propagating." 4 | categories = ["comparisons"] 5 | weight = 810 6 | +++ 7 | 8 | Returns true if this result is successful and its value compares equal to the value in the success type sugar. Comparison is done using `operator==` on `value_type` and `A`. If `A` is `void`, this call aliases {{% api "bool has_value() const noexcept" %}}. 9 | 10 | *Requires*: `operator==` must be a valid expression between `value_type` and `A`, or `A` is `void`. If `value_type` is `void`, then so must be `A`. 11 | 12 | *Complexity*: Whatever the underlying `operator==` has. Constexpr and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: None. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/move_assignment.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result &operator=(basic_result &&)`" 3 | description = "Move assignment. Constexpr, triviality and noexcept propagating." 4 | categories = ["operators", "assignment", "move-assignment"] 5 | weight = 130 6 | +++ 7 | 8 | Move assignment. 9 | 10 | *Requires*: that `value_type` and `error_type` both implement move assignment. 11 | 12 | *Complexity*: If the `value_type` for both is present, uses `value_type`'s move assignment operator, else either destructs or move constructs `value_type` as appropriate. `error_type`'s move assignment operator is always used. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/move_constructor.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`basic_result(basic_result &&)`" 3 | description = "Move constructor. Constexpr, triviality and noexcept propagating." 4 | categories = ["constructors", "implicit-constructors", "move-constructors"] 5 | weight = 110 6 | +++ 7 | 8 | Move constructor. 9 | 10 | *Requires*: that `value_type` and `error_type` both implement a move constructor. 11 | 12 | *Complexity*: Same as for `value_type`'s and `error_type`'s move constructors. Constexpr, triviality and noexcept of underlying operations is propagated. 13 | 14 | *Guarantees*: If an exception is thrown during the operation, the object is left in a partially completed state, as per the normal rules for the same operation on a `struct`. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/operator_bool.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`explicit operator bool() const noexcept`" 3 | description = "Returns true if a value is present. Constexpr, never throws." 4 | categories = ["observers"] 5 | weight = 590 6 | +++ 7 | 8 | Returns true if a value is present. Constexpr where possible. Alias for {{% api "bool has_value() const noexcept" %}}. 9 | 10 | *Requires*: Always available. 11 | 12 | *Complexity*: Constant time. 13 | 14 | *Guarantees*: Never throws an exception. 15 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/value_lvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &value() &`" 3 | description = "Wide contract lvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 640 6 | +++ 7 | 8 | Wide contract lvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/value_lvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &value() const &`" 3 | description = "Wide contract const lvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 650 6 | +++ 7 | 8 | Wide contract const lvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/value_rvalue.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`value_type &&value() &&`" 3 | description = "Wide contract rvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 660 6 | +++ 7 | 8 | Wide contract rvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/basic_result/value_rvalue_const.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`const value_type &&value() const &&`" 3 | description = "Wide contract const rvalue reference observer of any value present. Constexpr propagating." 4 | categories = ["observers"] 5 | weight = 670 6 | +++ 7 | 8 | Wide contract const rvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned. 9 | 10 | Note that if `value_type` is `void`, only a `const` overload returning `void` is present. 11 | 12 | *Requires*: Always available. 13 | 14 | *Complexity*: Depends on `NoValuePolicy::wide_value_check()`. 15 | 16 | *Guarantees*: None. 17 | -------------------------------------------------------------------------------- /doc/src/content/reference/types/in_place_type_t.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`in_place_type_t`" 3 | description = "Either `std::in_place_type_t` or a local emulation, depending on the `OUTCOME_USE_STD_IN_PLACE_TYPE` macro." 4 | +++ 5 | 6 | Either `std::in_place_type_t` or a local emulation, depending on the 7 | {{% api "OUTCOME_USE_STD_IN_PLACE_TYPE" %}} macro. 8 | 9 | Note that the templated variable `in_place_type` is also aliased or emulated locally. 10 | 11 | *Requires*: Nothing. 12 | 13 | *Namespace*: `OUTCOME_V2_NAMESPACE` 14 | 15 | *Header*: `` 16 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Tutorial" 3 | weight = 10 4 | +++ 5 | 6 | {{% children description="true" depth="2" %}} 7 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/advanced/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Advanced" 3 | description = "If you have a bit more time, this covers all the time-saving ways you can customise and automate Outcome for various use cases, especially in larger codebases made up of multiple third party libraries." 4 | weight = 20 5 | +++ 6 | 7 | {{% children description="true" depth="2" %}} 8 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/advanced/constructors/metaprogrammg2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "construct" 3 | description = "" 4 | weight = 50 5 | +++ 6 | 7 | First, we need a base definition for `make`: 8 | 9 | {{% snippet "constructors.cpp" "construct-declaration" %}} 10 | 11 | This fails a static assert if the type is ever instantiated unspecialised. 12 | 13 | We then specialise for `make`: 14 | 15 | {{% snippet "constructors.cpp" "construct-specialisation" %}} 16 | 17 | Because this is a struct, we can list initialise `make`, and use 18 | default member initialisers to implement default arguments. This can get 19 | you surprisingly far before you need to start writing custom constructors. 20 | 21 | But in more complex code, you will usually provide all the initialisation overloads that 22 | you would for the constructors of your main type. You then implement a single phase 2 constructing 23 | function which accepts `make` as input, and construct solely from 24 | that source. 25 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/advanced/interop/app-map-filelib.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Mapping the File I/O library into the Application" 3 | weight = 40 4 | +++ 5 | 6 | To handle the File I/O library, once again we turn to custom `ValueOrError` 7 | converters: 8 | 9 | {{% snippet "finale.cpp" "app_map_filelib" %}} 10 | 11 | Note that the conversion exactly duplicates the implementation of 12 | `throw_as_system_error_with_payload(failure_info fi)` from 13 | namespace `filelib`. In a production implementation, you probably 14 | ought to call that function and catch the exception it throws 15 | into a pointer, as that would be more long term maintainable. 16 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/advanced/interop/app-map-tidylib.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Mapping the HTMLTidy library into the Application" 3 | weight = 45 4 | +++ 5 | 6 | Once again, we create a custom STL exception type to represent failure 7 | from the HTMLTidy library. We also create an `app` namespace wrapper 8 | for the C `tidy_html()` function which is more C++ friendly. 9 | 10 | {{% snippet "finale.cpp" "app_map_tidylib" %}} 11 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/advanced/interop/filelib.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "The File I/O library" 3 | weight = 20 4 | +++ 5 | 6 | The File I/O library we shall be using is very similar [to the one we saw earlier 7 | in this tutorial](../../payload/copy_file2): 8 | 9 | {{% snippet "finale.cpp" "filelib" %}} 10 | 11 | This uses the advanced Outcome feature of programming the lazy synthesis of 12 | custom C++ exception throws from a payload carrying `E` type called `failure_info`. 13 | Like the HTTP library, it too template aliases a localised `result` implementation 14 | into its namespace with ADL bridging so Outcome customisation points can be 15 | discovered. 16 | 17 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/advanced/interop/httplib.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "The HTTP library" 3 | weight = 10 4 | +++ 5 | 6 | Let us imagine a simple application: it fetches a HTTP page using a HTTP library, 7 | sends it through HTML tidy via the htmltidy library, and then writes it to disc 8 | using a filelib library. So three third party libraries, two using Outcome in 9 | incompatible ways, and the third being a C library just for kicks. 10 | 11 | Let us imagine that the HTTP library has the following public interface: 12 | 13 | {{% snippet "finale.cpp" "httplib" %}} 14 | 15 | The HTTP library is a mixed-failure design. Likely failures (HTTP status codes) 16 | are returned via `httplib::failure`, unlikely failures (e.g. out of memory) 17 | are returned via throw of the usual STL exception types. 18 | 19 | The sole API we bother describing is an implementation of HTTP GET. It fetches 20 | a URL, and either returns the contents or the failure reason why not. 21 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/advanced/interop/tidylib.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "The HTMLTidy library" 3 | weight = 15 4 | +++ 5 | 6 | {{% snippet "finale.cpp" "tidylib" %}} 7 | 8 | A C API may not initially appear to be a `T|E` based API, but if failure 9 | returns some domained error code and causes no other effects, and success 10 | returns some value, then it is effectively a "split" `T|E` API. The above 11 | is an example of exactly that form of "split" `T|E` API. -------------------------------------------------------------------------------- /doc/src/content/tutorial/essential/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Essential" 3 | description = "The absolute minimum that you need to know to get started with Outcome immediately." 4 | weight = 10 5 | +++ 6 | 7 | {{% children description="true" depth="2" %}} 8 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/essential/coroutines/co_await.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "`operator co_await` as TRY operator" 3 | weight = 40 4 | tags = [ "coroutines", "co_await" ] 5 | +++ 6 | 7 | Many people have requested that `operator co_await` be overloaded to 8 | behave as a TRY operator when supplied with an Outcome type. 9 | 10 | Outcome does not implement that extension, nor will we accept PRs 11 | contributing support for this. We think you should use `OUTCOME_CO_TRY()` 12 | as this will lead to more maintainable and future proof code. 13 | 14 | However, we deliberately do not get in the way of you implementing 15 | that overload yourself in your own Outcome-based code. Just be sure 16 | that you document what you are doing loudly and clearly, and be 17 | aware that future C++ standards may have a proper `operator try` 18 | overload mechanism. 19 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/essential/coroutines/try.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Coroutine TRY operation" 3 | weight = 10 4 | tags = [ "coroutines", "try" ] 5 | +++ 6 | 7 | As one cannot call statement `return` from within a Coroutine, the very first part of Outcome's 8 | support for Coroutines is {{% api "OUTCOME_CO_TRYV(expr)/OUTCOME_CO_TRY(expr)" %}}, 9 | which is literally the same as `OUTCOME_TRY()` except that `co_return` is called 10 | to return early instead of `return`. 11 | 12 | ```c++ 13 | eager> to_string(int x) 14 | { 15 | if(x >= 0) 16 | { 17 | OUTCOME_CO_TRY(convert(x)); 18 | } 19 | co_return "out of range"; 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/essential/no-value/custom.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "A custom no-value policy" 3 | description = "" 4 | weight = 10 5 | +++ 6 | 7 | If you want your `basic_outcome<>` or `basic_result<>` instances to call 8 | `std::abort()` whenever `.value()` is called on an object that does not contain a value, or `.error()` is called on an object that does not contain an error, you will need to define your own no-value policy as follows: 9 | 10 | {{% snippet "policies.cpp" "abort_policy" %}} 11 | 12 | All policies ought to inherit from {{% api "base" %}} in order to provide your policy implementation with 13 | the internal policy API for accessing and manipulating `result` and `outcome` state. 14 | 15 | Once the policy is defined, you have to specify it when providing your own 16 | `basic_outcome` specialization: 17 | 18 | {{% snippet "policies.cpp" "outcome_spec" %}} 19 | -------------------------------------------------------------------------------- /doc/src/content/tutorial/essential/outcome/layer_chart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/doc/src/content/tutorial/essential/outcome/layer_chart.gif -------------------------------------------------------------------------------- /doc/src/layouts/partials/custom-head.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/src/layouts/shortcodes/boost-copyright.html: -------------------------------------------------------------------------------- 1 | {{- if in .Site.Title "Boost." }}

6 | 7 |
8 |

9 | Distributed under the Boost Software License, Version 1.0. (See accompanying 10 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 11 |

12 |
13 | {{ partial "boost-index" (dict "context" . "toc_depth" 2) }} 14 |

Introduction

15 | {{- end}} -------------------------------------------------------------------------------- /doc/src/layouts/shortcodes/ghcontributors.html: -------------------------------------------------------------------------------- 1 | 22 |
23 | {{ $url := .Get 0 }} 24 | {{ range getJSON $url }} 25 |
26 | 27 | 28 | {{.contributions}} commits 29 |
30 | {{ end }} 31 |
-------------------------------------------------------------------------------- /doc/src/layouts/shortcodes/if_boost.html: -------------------------------------------------------------------------------- 1 | {{- if in .Site.Title "Boost." }} 2 |
3 | {{- else }} 4 | {{ .Inner }} 5 | 6 | {{- end }} -------------------------------------------------------------------------------- /doc/src/layouts/shortcodes/slides.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /doc/src/layouts/shortcodes/snippet.md: -------------------------------------------------------------------------------- 1 |
{{ $snippet := split (readFile (printf "snippets/%s" (.Get 0))) (printf "//! [%s]" (.Get 1)) }}{{ $lineno := split (index $snippet 0) "\n" | len }}{{highlight (strings.TrimLeft "\r\n" (strings.TrimRight "\r\n " (index $snippet 1))) "c++" ""}}View this code on Github
2 | -------------------------------------------------------------------------------- /doc/src/layouts/shortcodes/toc.html: -------------------------------------------------------------------------------- 1 | {{if not (in .Site.Title "Boost.") }}{{ $.Page.TableOfContents }}{{end}} -------------------------------------------------------------------------------- /include/outcome.ixx: -------------------------------------------------------------------------------- 1 | module; 2 | #include <__msvc_all_public_headers.hpp> 3 | // *** Everything before here is replaced by cmake! 4 | 5 | // Tell the headers we are generating the interface for the library 6 | #define GENERATING_OUTCOME_MODULE_INTERFACE 7 | 8 | #include "outcome/try.hpp" 9 | 10 | export module OUTCOME_V2_CXX_MODULE_NAME; 11 | #include "outcome.hpp" 12 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Please go to doc/html/index.html 4 | 5 | -------------------------------------------------------------------------------- /install_dev_githooks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo Installing post-merge hook which recursively forces all 3 | echo submodules to latest commit after every git pull 4 | cat <> .git/hooks/post-merge 5 | #!/bin/sh 6 | git submodule foreach --recursive 'branch=\$(git config -f \$toplevel/.gitmodules submodule.\$name.branch); [ \"\$branch\" = \"\" ] && branch=master; git checkout \$branch; git merge origin/\$branch;' 7 | EOT 8 | chmod +x .git/hooks/post-merge 9 | echo Installing custom 'git pull-all' command for recursively 10 | echo forcing all submodules to latest commit 11 | git config alias.pull-all "submodule foreach --recursive 'branch=\$(git config -f \$toplevel/.gitmodules submodule.\$name.branch); [ \"\$branch\" = \"\" ] && branch=master; git checkout \$branch; git pull;'" 12 | -------------------------------------------------------------------------------- /test/constexprs/.boostish: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ned14/outcome/744da6b7536f2850df972ab01504e3c4d9530149/test/constexprs/.boostish -------------------------------------------------------------------------------- /test/constexprs/clang.csv: -------------------------------------------------------------------------------- 1 | "WG21_P1886","WG21_P1886a","max_result_construct_value_move_destruct","max_result_get_value","min_result_construct_value_move_destruct","min_result_get_value" 2 | 33,48,106,106,1,1 3 | -------------------------------------------------------------------------------- /test/constexprs/gcc.csv: -------------------------------------------------------------------------------- 1 | "WG21_P1886","WG21_P1886a","max_result_construct_value_move_destruct","max_result_get_value","min_result_construct_value_move_destruct","min_result_get_value" 2 | 44,49,116,116,1,1 3 | -------------------------------------------------------------------------------- /test/constexprs/min_result_construct_value_move_destruct.clang.S.test1.s: -------------------------------------------------------------------------------- 1 | 400630: b8 05 00 00 00 mov $0x5,%eax 2 | 400635: c3 retq 3 | 400636: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 4 | -------------------------------------------------------------------------------- /test/constexprs/min_result_construct_value_move_destruct.gcc.S.test1.s: -------------------------------------------------------------------------------- 1 | 940: b8 05 00 00 00 mov $0x5,%eax 2 | 945: c3 retq 3 | 946: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 4 | -------------------------------------------------------------------------------- /test/constexprs/min_result_get_value.clang.S.test1.s: -------------------------------------------------------------------------------- 1 | 400630: b8 05 00 00 00 mov $0x5,%eax 2 | 400635: c3 retq 3 | 400636: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 4 | -------------------------------------------------------------------------------- /test/constexprs/min_result_get_value.gcc.S.test1.s: -------------------------------------------------------------------------------- 1 | 940: b8 05 00 00 00 mov $0x5,%eax 2 | 945: c3 retq 3 | 946: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 4 | -------------------------------------------------------------------------------- /test/constexprs/msvc.csv: -------------------------------------------------------------------------------- 1 | "WG21_P1886","WG21_P1886a","max_result_construct_value_move_destruct","max_result_get_value","min_result_construct_value_move_destruct","min_result_get_value" 2 | 40,111,502,497,514,509 3 | --------------------------------------------------------------------------------