• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1+++
2title = "`default_policy<T, EC, EP>`"
3description = "A type alias to a no-value policy selected based on traits matching of `T`, `EC` and `EP`."
4+++
5
6A type alias to a no-value policy selected based on traits matching of `T`, `EC` and `EP`. It is defined as follows:
7
81. If `EC` and `EP` is `void`, choose {{% api "terminate" %}}.
9
102. If {{% api "is_error_code_available<T>" %}} true for `EC`, choose {{% api "error_code_throw_as_system_error<T, EC, EP>" %}} for `basic_outcome` or {{% api "error_code_throw_as_system_error<T, EC, void>" %}} for `basic_result`.
11
123. If {{% api "is_exception_ptr_available<T>" %}} true for `EC` or `EP`, choose {{% api "exception_ptr_rethrow<T, EC, EP>" %}} for `basic_outcome` or {{% api "exception_ptr_rethrow<T, EC, void>" %}} for `basic_result`.
13
144. Else choose {{% api "fail_to_compile_observers" %}}, which fails the build with a useful message.
15
16*Namespace*: `BOOST_OUTCOME_V2_NAMESPACE::policy`
17
18*Header*: `<boost/outcome/std_result.hpp>`
19