Unnamed: 0
int64 0
0
| repo_id
stringlengths 5
186
| file_path
stringlengths 15
223
| content
stringlengths 1
32.8M
⌀ |
---|---|---|---|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/result.md | +++
title = "`result<T, E = varies, NoValuePolicy = policy::default_policy<T, E, void>>`"
description = "A type alias to a `std_result<T, E, NoValuePolicy>` (standalone edition) or `boost_result<T, E, NoValuePolicy>` (Boost edition)."
+++
A type alias to either {{% api "std_result<T, E = std::error_code, NoValuePolicy = policy::default_policy<T, E, void>>" %}} (standalone edition) or {{% api "boost_result<T, E = boost::system::error_code, NoValuePolicy = policy::default_policy<T, E, void>>" %}} (Boost edition), and `policy::`{{% api "default_policy" %}}. This means that `result<T>` uses the appropriate default alias depending on which edition of Outcome is in use.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/result.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/std_checked.md | +++
title = "`std_checked<T, E = std::error_code>`"
description = "A type alias to a `basic_result` configured with `std::error_code` and `policy::throw_bad_result_access<EC>`."
+++
A type alias to a {{% api "basic_result<T, E, NoValuePolicy>" %}} configured with {{% api "std::error_code" %}} and `policy::`{{% api "throw_bad_result_access<EC>" %}}.
This type alias always references the `std` edition of things, unlike {{% api "checked<T, E = varies>" %}} which references either this alias or {{% api "boost_checked<T, E = boost::system::error_code>" %}}.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/std_result.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/boost_result.md | +++
title = "`boost_result<T, E = boost::system::error_code, NoValuePolicy = policy::default_policy<T, E, void>>`"
description = "A type alias to a `basic_result` configured with `boost::system::error_code` and `policy::default_policy`."
+++
A type alias to a {{% api "basic_result<T, E, NoValuePolicy>" %}} configured with `boost::system::error_code` and `policy::`{{% api "default_policy" %}}.
This type alias always references the `boost` edition of things, unlike {{% api "result<T, E = varies, NoValuePolicy = policy::default_policy<T, E, void>>" %}} which references either this alias or {{% api "std_result<T, E = std::error_code, NoValuePolicy = policy::default_policy<T, E, void>>" %}}.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/boost_result.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/std_unchecked.md | +++
title = "`std_unchecked<T, E = std::error_code>`"
description = "A type alias to a `basic_result` configured with `std::error_code` and `policy::all_narrow`."
+++
A type alias to a {{% api "basic_result<T, E, NoValuePolicy>" %}} configured with {{% api "std::error_code" %}} and `policy::`{{% api "all_narrow" %}}.
This type alias always references the `std` edition of things, unlike {{% api "unchecked<T, E = varies>" %}} which references either this alias or {{% api "boost_unchecked<T, E = boost::system::error_code>" %}}.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/std_result.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/boost_outcome.md | +++
title = "`boost_outcome<T, EC = boost::system::error_code, EP = boost::exception_ptr, NoValuePolicy = policy::default_policy<T, EC, EP>>`"
description = "A type alias to a `basic_outcome` configured with `boost::system::error_code`, `boost::exception_ptr` and `policy::default_policy`."
+++
A type alias to a {{% api "basic_outcome<T, EC, EP, NoValuePolicy>" %}} configured with {{% api "boost::system::error_code" %}}, {{% api "boost::exception_ptr" %}} and `policy::`{{% api "default_policy" %}}.
This type alias always references the `std` edition of things, unlike {{% api "outcome<T, EC = varies, EP = varies, NoValuePolicy = policy::default_policy<T, EC, EP>>" %}} which references either this alias or {{% api "std_outcome<T, EC = std::error_code, EP = std::exception_ptr, NoValuePolicy = policy::default_policy<T, EC, EP>>" %}}.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/boost_outcome.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/unchecked.md | +++
title = "`unchecked<T, E = varies>`"
description = "A type alias to a `std_unchecked<T, E>` (standalone edition) or `boost_unchecked<T, E>` (Boost edition)."
+++
A type alias to either {{% api "std_unchecked<T, E = std::error_code>" %}} (standalone edition) or {{% api "boost_unchecked<T, E = boost::system::error_code>" %}} (Boost edition). This means that `unchecked<T>` uses the appropriate default alias depending on which edition of Outcome is in use.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/result.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/std_outcome.md | +++
title = "`std_outcome<T, EC = std::error_code, EP = std::exception_ptr, NoValuePolicy = policy::default_policy<T, EC, EP>>`"
description = "A type alias to a `basic_outcome` configured with `std::error_code`, `std::exception_ptr` and `policy::default_policy`."
+++
A type alias to a {{% api "basic_outcome<T, EC, EP, NoValuePolicy>" %}} configured with {{% api "std::error_code" %}}, {{% api "std::exception_ptr" %}} and `policy::`{{% api "default_policy" %}}.
This type alias always references the `std` edition of things, unlike {{% api "outcome<T, EC = varies, EP = varies, NoValuePolicy = policy::default_policy<T, EC, EP>>" %}} which references either this alias or {{% api "boost_outcome<T, EC = boost::system::error_code, EP = boost::exception_ptr, NoValuePolicy = policy::default_policy<T, EC, EP>>" %}}.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/std_outcome.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/default_policy.md | +++
title = "`default_policy<T, EC, EP>`"
description = "A type alias to a no-value policy selected based on traits matching of `T`, `EC` and `EP`."
+++
A type alias to a no-value policy selected based on traits matching of `T`, `EC` and `EP`. It is defined as follows:
1. If `EC` and `EP` is `void`, choose {{% api "terminate" %}}.
2. 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`.
3. 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`.
4. Else choose {{% api "fail_to_compile_observers" %}}, which fails the build with a useful message.
*Namespace*: `OUTCOME_V2_NAMESPACE::policy`
*Header*: `<outcome/std_result.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/aliases/boost_unchecked.md | +++
title = "`boost_unchecked<T, E = boost::system::error_code>`"
description = "A type alias to a `basic_result` configured with `boost::system::error_code` and `policy::all_narrow`."
+++
A type alias to a {{% api "basic_result<T, E, NoValuePolicy>" %}} configured with `boost::system::error_code` and `policy::`{{% api "all_narrow" %}}.
This type alias always references the `boost` edition of things, unlike {{% api "unchecked<T, E = varies>" %}} which references either this alias or {{% api "std_unchecked<T, E = std::error_code>" %}}.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/boost_result.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/converters/_index.md | +++
title = "Converters"
weight = 25
+++
{{% children description="true" depth="2" %}}
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/converters/value_or_error.md | +++
title = "`value_or_error<T, U>`"
description = "A customisable converter of `value_or_error<T, E>` concept matching types."
+++
A customisable converter of {{% api "concepts::value_or_error<T, E>" %}} concept matching types. It must have the following form:
```c++
// `T` will be the destination basic_result or basic_outcome.
// `U` will be the decayed form of the `value_or_error<T, E>` concept matching input type.
template <class T> struct value_or_error<T, U>
{
// False to indicate that this converter wants `basic_result`/`basic_outcome` to reject all other `basic_result`
static constexpr bool enable_result_inputs = false;
// False to indicate that this converter wants `basic_outcome` to reject all other `basic_outcome`
static constexpr bool enable_outcome_inputs = false;
// `X` will be the raw input form of `U`. It must return a `T`.
template<class X> constexpr T operator()(X &&v);
};
```
*Overridable*: By template specialisation into the `convert` namespace.
*Default*: If decayed `X` is same as `U`, concept `value_or_error<U>` matches, `X::value_type` is `void` or is explicitly constructible to `T::value_type`, and `X::error_type` is `void` or is explicitly constructible to `T::error_type`, then `operator()(X &&)` is made available.
`operator()(X &&v)` tests if `v.has_value()` is true, if so then a `T` with successful value is returned, else a `T` with unsuccessful value. If the input type was `void`, a default constructed value is used for either, else a move/copy construction from the source is performed.
*Namespace*: `OUTCOME_V2_NAMESPACE::convert`
*Header*: `<outcome/convert.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/types/_index.md | +++
title = "Types"
weight = 50
+++
{{% children description="true" depth="2" %}}
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/types/success_type.md | +++
title = "`success_type<T>`"
description = "Type sugar for constructing a successful result or outcome."
+++
Type sugar for constructing a successful result or outcome. Generally not constructed directly, but via the free function {{% api "success(T &&, ...)" %}}. Detectable using {{% api "is_success_type<T>" %}}.
This is a regular wrapper type, with defaulted default, copy and move constructor, defaulted assignment, and defaulted destructor.
A member type alias `value_type` indicates `T`.
There is an explicit initialising constructor taking any type `U` which is not a `success_type<T>`, and which will forward construct the contained `T` from that `U`. It also has an optional parameter `spare_storage`, if you wish to specify a spare storage value.
There is a `.value()` reference observer with the usual constexpr lvalue, const lvalue, rvalue and const rvalue overloads.
There is a specialisation `success_type<void>` which stores nothing and provides no `.value()` observers.
There is a `.spare_storage()` observer which returns the spare storage value with which the success type sugar was constructed.
*Requires*: Nothing.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/success_failure.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/types/bad_result_access_with.md | +++
title = "`bad_result_access_with<EC>`"
description = "Exception type publicly inheriting from `bad_result_access` indicating an incorrect observation of value occurred, supplying the error value."
+++
Exception type publicly inheriting from {{% api "bad_result_access" %}}, and thus also {{% api "std::logic_error" %}}, indicating an incorrect observation of value occurred. The error value at the time of the exception throw is moved or copied into this type, and is available using the `.error()` observer which comes in lvalue ref, const lvalue ref, rvalue ref, and const rvalue ref overloads.
The primary purpose of this exception type is to enable standing in for {{% api "std::expected<T, E>" %}}'s `bad_expected_access<E>` which is thrown on incorrect wide value observation. This is why it is only ever `EC` which is thrown with `bad_result_access_with<EC>` on value observation only, and only when there is an error available. See the {{% api "throw_bad_result_access<EC>" %}} policy for more information.
*Requires*: Nothing.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/bad_access.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/types/failure_type.md | +++
title = "`failure_type<EC, EP = void>`"
description = "Type sugar for constructing an unsuccessful result or outcome."
+++
Type sugar for constructing an unsuccessful result or outcome. Generally not constructed directly, but via the free function {{% api "failure(T &&, ...)" %}}. Detectable using {{% api "is_failure_type<T>" %}}.
This is a regular wrapper type, with defaulted default, copy and move constructor, defaulted assignment, and defaulted destructor.
Member type aliases `error_type` and `exception_type` indicate `EC` and `E`.
There is an explicit initialising constructor taking any types `U` and `V` which will forward construct the contained `error_type` and `exception_type` respectively. It also has an optional parameter `spare_storage`, if you wish to specify a spare storage value.
There are two tagged initialising constructors taking `in_place_type_t<error_type>` or `in_place_type_t<exception_type>`, and a `U` which will forward construct the contained `error_type` and `exception_type` respectively. These both also have an optional parameter `spare_storage`, if you wish to specify a spare storage value.
There are `.error()` and `.exception()` reference observers with the usual constexpr lvalue, const lvalue, rvalue and const rvalue overloads. One can discover which or both of these is valid using the usual `.has_error()` and `.has_exception()` observers.
There is a `.spare_storage()` observer which returns the spare storage value with which the failure type sugar was constructed.
There are specialisations `failure_type<EC, void>` and `failure_type<void, E>` which store nothing for the voided type and do not provide their observer functions.
*Requires*: Nothing.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/success_failure.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/types/in_place_type_t.md | +++
title = "`in_place_type_t<T>`"
description = "Either `std::in_place_type_t<T>` or a local emulation, depending on the `OUTCOME_USE_STD_IN_PLACE_TYPE` macro."
+++
Either `std::in_place_type_t<T>` or a local emulation, depending on the
{{% api "OUTCOME_USE_STD_IN_PLACE_TYPE" %}} macro.
Note that the templated variable `in_place_type` is also aliased or emulated locally.
*Requires*: Nothing.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/config.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/types/bad_result_access.md | +++
title = "`bad_result_access`"
description = "Exception type publicly inheriting from `std::logic_error` indicating an incorrect observation of value or error occurred."
+++
Exception type publicly inheriting from {{% api "std::logic_error" %}} indicating an incorrect observation of value or error occurred by {{% api "basic_result<T, E, NoValuePolicy>" %}}.
No member functions are added in addition to `std::logic_error`. Typical `.what()` strings are:
- `"no value"`
- `"no error"`
*Requires*: Nothing.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/bad_access.hpp>`
|
0 | repos/outcome/doc/src/content/reference | repos/outcome/doc/src/content/reference/types/bad_outcome_access.md | +++
title = "`bad_outcome_access`"
description = "Exception type publicly inheriting from `std::logic_error` indicating an incorrect observation of value or error or exception occurred."
+++
Exception type publicly inheriting from {{% api "std::logic_error" %}} indicating an incorrect observation of value or error or exception occurred by {{% api "basic_outcome<T, EC, EP, NoValuePolicy>" %}}.
No member functions are added in addition to `std::logic_error`. Typical `.what()` strings are:
- `"no value"`
- `"no error"`
- `"no exception"`
*Requires*: Nothing.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/bad_access.hpp>`
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/operator_bool.md | +++
title = "`explicit operator bool() const noexcept`"
description = "Returns true if a value is present. Constexpr, never throws."
categories = ["observers"]
weight = 590
+++
Returns true if a value is present. Constexpr where possible. Alias for {{% api "bool has_value() const noexcept" %}}.
*Requires*: Always available.
*Complexity*: Constant time.
*Guarantees*: Never throws an exception.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/inequality_failure_type.md | +++
title = "`bool operator!=(const failure_type<A, B> &) const`"
description = "Returns true if this outcome does not compare equal to the failure type sugar. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 860
+++
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`.
*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`.
*Complexity*: Whatever the underlying `operator!=` has. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_value_rvalue.md | +++
title = "`value_type &&assume_value() && noexcept`"
description = "Narrow contract rvalue reference observer of any value present. Constexpr propagating, never throws."
categories = ["observers"]
weight = 620
+++
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.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_value_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_value_converting_constructor.md | +++
title = "`basic_outcome(R &&)`"
description = "Implicit `value_type` constructor. Available if `predicate::enable_value_converting_constructor<R>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "converting-constructors"]
weight = 180
+++
Implicit `value_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `R`.
*Requires*: `predicate::enable_value_converting_constructor<R>` is true.
*Complexity*: Same as for `value_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/disabling_catchall.md | +++
title = "`basic_outcome(Args...) = delete`"
description = "Disabling catchall constructor used to give useful diagnostic error when trying to use non-inplace constructors when `predicate::constructors_enabled` is false."
categories = ["constructors", "disabling-constructors"]
weight = 160
+++
Disabling catchall constructor used to give useful diagnostic error when trying to use non-inplace constructors when `predicate::constructors_enabled` is false.
*Requires*: `predicate::constructors_enabled` is false.
*Complexity*: N/A. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/move_assignment.md | +++
title = "`basic_outcome &operator=(basic_outcome &&)`"
description = "Move assignment. Constexpr, triviality and noexcept propagating."
categories = ["operators", "assignment", "move-assignment"]
weight = 130
+++
Move assignment.
*Requires*: that `value_type`, `error_type` and `exception_type` all implement move assignment.
*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.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_success_move_constructor.md | +++
title = "`basic_outcome(success_type<T> &&)`"
description = "Implicit value-from-success-type-sugar move constructor. Available if `predicate::enable_compatible_conversion<T, void, void>` is true, or `T` is `void`. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 510
+++
Implicit value-from-success-type-sugar move constructor used to disambiguate the construction of the value type.
Note that if `T = void`, `value_type` will be default constructed. Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and `success_type<T> &&`.
*Requires*: `predicate::enable_compatible_conversion<T, void, void>` is true, or `T` is `void`.
*Complexity*: Same as for the `value_type` constructor which accepts `T`, or the `value_type` default constructor if `T` is `void`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/value_lvalue_const.md | +++
title = "`const value_type &value() const &`"
description = "Wide contract const lvalue reference observer of any value present. Constexpr propagating."
categories = ["observers"]
weight = 650
+++
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.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_value_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_inplace_value_constructor_il.md | +++
title = "`explicit basic_outcome(in_place_type_t<value_type_if_enabled>, std::initializer_list<U>, Args ...)`"
description = "Explicit inplace value constructor. Available if `predicate::enable_inplace_value_constructor<std::initializer_list<U>, Args ...>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "inplace-constructors"]
weight = 410
+++
Explicit inplace value constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept" %}} with `this`, `in_place_type<value_type>`, 'std::initializer_list<U>' and `Args ...`.
*Requires*: `predicate::enable_inplace_value_constructor<std::initializer_list<U>, Args ...>` is true.
*Complexity*: Same as for the `value_type` constructor which accepts `std::initializer_list<U>, Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated.
*Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_inplace_error_constructor.md | +++
title = "`explicit basic_outcome(in_place_type_t<error_type_if_enabled>, Args ...)`"
description = "Explicit inplace error constructor. Available if `predicate::enable_inplace_error_constructor<Args ...>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "inplace-constructors"]
weight = 420
+++
Explicit inplace error constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept" %}} with `this`, `in_place_type<error_type>` and `Args ...`.
*Requires*: `predicate::enable_inplace_error_constructor<Args ...>` is true.
*Complexity*: Same as for the `error_type` constructor which accepts `Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated.
*Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/_index.md | +++
title = "`basic_outcome<T, EC, EP, NoValuePolicy>`"
description = "A type carrying one of (i) a successful `T` (ii) a disappointment `EC` (iii) a failure `EP` (iv) both a disappointment `EC` and a failure `EP`, with `NoValuePolicy` specifying what to do if one tries to read state which isn't there."
+++
A type carrying one of (i) a successful `T` (ii) a disappointment `EC` (iii) a failure `EP` (iv) both a disappointment `EC` and a failure `EP`, with `NoValuePolicy` specifying what to do if one tries to read state which isn't there, and enabling injection of hooks to trap when lifecycle events occur. Any one, two, or all of `T`, `EC` and `EP` can be `void` to indicate no value for that state is present. Detectable using {{% api "is_basic_outcome<T>" %}}.
*Requires*: Concept requirements if C++ 20, else static asserted:
- That trait {{% api "type_can_be_used_in_basic_result<R>" %}} is true for `T`, `EC` and `EP`.
- That either `EC` is `void` or `DefaultConstructible` (Outcome v2.1 and earlier only).
- That either `EP` is `void` or `DefaultConstructible`.
*Namespace*: `OUTCOME_V2_NAMESPACE`
*Header*: `<outcome/basic_outcome.hpp>`
*Inclusions*: The very lightest weight of C and C++ header files:
1. `<cstdint>`
2. `<initializer_list>`
3. `<iosfwd>`
4. `<new>`
5. `<type_traits>`
6. If {{% api "OUTCOME_USE_STD_IN_PLACE_TYPE" %}} is `1`, `<utility>` (defaults to `1` for C++ 17 or later only)
7. If C++ exceptions disabled and `OUTCOME_DISABLE_EXECINFO` undefined only (used to print stack backtraces on "exception throw"):
1. `<sal.h>` (Windows only)
2. `<stddef.h>` (Windows only)
3. `<string.h>` (Windows only)
4. `<execinfo.h>` (POSIX only)
8. `<cstdio>`
9. `<cstdlib>`
10. `<cassert>`
This very light weight set of inclusion dependencies makes basic outcome suitable for use in global header files of very large C++ codebases.
### Design rationale
`basic_outcome` extends {{% api "basic_result<T, E, NoValuePolicy>" %}} with a third state to transport,
conventionally (but not necessarily) some sort of "abort" or "exceptional" state which a function can
return to indicate that not only did the operation fail, but it did so *catastrophically* i.e. please
abort any attempt to retry the operation.
A perfect alternative is to throw a C++ exception for the abort code path, and indeed most programs
ought to do exactly that instead of using `basic_outcome`. However there are a number of use cases
where choosing `basic_outcome` shines:
1. Where C++ exceptions or RTTI is not available, but the ability to fail catastrophically without
terminating the program is important.
2. Where deterministic behaviour is required even in the catastrophic failure situation.
3. In unit test suites of code using Outcome it is extremely convenient to accumulate test failures
into a `basic_outcome` for later reporting. A similar convenience applies to RPC situations, where
C++ exception throws need to be accumulated for reporting back to the initiating endpoint.
4. Where a function is "dual use deterministic" i.e. it can be used deterministically, in which case
one switches control flow based on `.error()`, or it can be used non-deterministically by throwing
an exception perhaps carrying a custom payload.
### Public member type aliases
- `value_type` is `T`.
- `error_type` is `EC`.
- `exception_type` is `EP`.
- `no_value_policy_type` is `NoValuePolicy`.
- `value_type_if_enabled` is `T` if construction from `T` is available, else it is a usefully named unusable internal type.
- `error_type_if_enabled` is `EC` if construction from `EC` is available, else it is a usefully named unusable internal type.
- `exception_type_if_enabled` is `EP` if construction from `EP` is available, else it is a usefully named unusable internal type.
- `rebind<A, B = EC, C = EP, D = NoValuePolicy>` is `basic_outcome<A, B, C, D>`.
### Protected member predicate booleans
- `predicate::constructors_enabled` is constexpr boolean true if:
1. Decayed `value_type` and decayed `error_type` are not the same type, or both are `void`.
2. Decayed `value_type` and decayed `exception_type` are not the same type, or both are `void`.
3. Decayed `error_type` and decayed `exception_type` are not the same type, or both are `void`.
- `predicate::implicit_constructors_enabled` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. Trait {{% api "is_error_type<E>" %}} is not true for both decayed `value_type` and decayed `error_type` at the same time.
3. `value_type` is not implicitly constructible from `error_type` and `error_type` is not implicitly constructible from `value_type`.<br>OR<br>trait {{% api "is_error_type<E>" %}} is true for decayed `error_type` and `error_type` is not implicitly constructible from `value_type` and `value_type` is an integral type.
4. `value_type` is not implicitly constructible from `exception_type`.
5. `error_type` is not implicitly constructible from `exception_type`.
6. `exception_type` is not implicitly constructible from `value_type`.
7. `exception_type` is not implicitly constructible from `error_type`.
- `predicate::enable_value_converting_constructor<A>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. Decayed `A` is not this `basic_outcome` type.
3. `predicate::implicit_constructors_enabled` is true.
4. Decayed `A` is not an `in_place_type_t`.
5. Trait {{% api "is_error_type_enum<E, Enum>" %}} is false for `error_type` and decayed `A`.
6. `value_type` is implicitly constructible from `A` and `error_type` is not implicitly constructible from `A`.<br>OR<br>`value_type` is the exact same type as decayed `A` and `value_type` is implicitly constructible from `A`.
7. `exception_type` is not implicitly constructible from `A`.
- `predicate::enable_error_converting_constructor<A>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. Decayed `A` is not this `basic_outcome` type.
3. `predicate::implicit_constructors_enabled` is true.
4. Decayed `A` is not an `in_place_type_t`.
5. Trait {{% api "is_error_type_enum<E, Enum>" %}} is false for `error_type` and decayed `A`.
6. `value_type` is not implicitly constructible from `A` and `error_type` is implicitly constructible from `A`.<br>OR<br>`error_type` is the exact same type as decayed `A` and `error_type` is implicitly constructible from `A`.
7. `exception_type` is not implicitly constructible from `A`.
- `predicate::enable_error_condition_converting_constructor<ErrorCondEnum>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. Decayed `ErrorCondEnum` is not this `basic_outcome` type.
3. Decayed `ErrorCondEnum` is not an `in_place_type_t`.
4. Trait {{% api "is_error_type_enum<E, Enum>" %}} is true for `error_type` and decayed `ErrorCondEnum`.
5. `exception_type` is not implicitly constructible from `ErrorCondEnum`.
- `predicate::enable_exception_converting_constructor<A>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. Decayed `A` is not this `basic_outcome` type.
3. `predicate::implicit_constructors_enabled` is true.
4. Decayed `A` is not an `in_place_type_t`.
5. `value_type` is not implicitly constructible from `A`.
6. `error_type` is not implicitly constructible from `A`.
7. `exception_type` is implicitly constructible from `A`.
- `predicate::enable_error_exception_converting_constructor<A, B>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. Decayed `A` is not this `basic_outcome` type.
3. `predicate::implicit_constructors_enabled` is true.
4. Decayed `A` is not an `in_place_type_t`.
5. `value_type` is not implicitly constructible from `A`.
6. `error_type` is implicitly constructible from `A`.
7. `value_type` is not implicitly constructible from `B`.
8. `exception_type` is implicitly constructible from `B`.
- `predicate::enable_compatible_conversion<A, B, C, D>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. `basic_outcome<A, B, C, D>` is not this `basic_outcome` type.
3. `A` is `void` OR `value_type` is explicitly constructible from `A`.
4. `B` is `void` OR `error_type` is explicitly constructible from `B`.
5. `C` is `void` OR `exception_type` is explicitly constructible from `C`.
- `predicate::enable_make_error_code_compatible_conversion<A, B, C, D>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. `basic_outcome<A, B, C, D>` is not this `basic_outcome` type.
3. Trait {{% api "is_error_code_available<T>" %}} is true for decayed `error_type`.
4. `predicate::enable_compatible_conversion<A, B, C, D>` is not true.
5. `A` is `void` OR `value_type` is explicitly constructible from `A`.
6. `error_type` is explicitly constructible from `make_error_code(B)`.
7. `C` is `void` OR `exception_type` is explicitly constructible from `C`.
- `predicate::enable_inplace_value_constructor<Args...>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. `value_type` is `void` OR `value_type` is explicitly constructible from `Args...`.
- `predicate::enable_inplace_error_constructor<Args...>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. `error_type` is `void` OR `error_type` is explicitly constructible from `Args...`.
- `predicate::enable_inplace_exception_constructor<Args...>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. `exception_type` is `void` OR `exception_type` is explicitly constructible from `Args...`.
- `predicate::enable_inplace_value_error_exception_constructor<Args...>` is constexpr boolean true if:
1. `predicate::constructors_enabled` is true.
2. `predicate::implicit_constructors_enabled` is true.
3. Exactly one of `value_type` is explicitly constructible from `Args...`, or `error_type` is explicitly constructible from `Args...`, or `exception_type` is explicitly constructible
from `Args...`.
#### Summary of [standard requirements provided](https://en.cppreference.com/w/cpp/named_req)
- ~~`DefaultConstructible`~~, always deleted to force user to choose valued or errored or excepted for every outcome instanced.
- `MoveConstructible`, if all of `value_type`, `error_type` and `exception_type` implement move constructors.
- `CopyConstructible`, if all of `value_type`, `error_type` and `exception_type` implement copy constructors.
- `MoveAssignable`, if all of `value_type`, `error_type` and `exception_type` implement move constructors and move assignment.
- `CopyAssignable`, if all of `value_type`, `error_type` and `exception_type` implement copy constructors and copy assignment.
- `Destructible`.
- `Swappable`, with the strong rather than weak guarantee. See {{% api "void swap(basic_outcome &)" %}} for more information.
- `TriviallyCopyable`, if all of `value_type`, `error_type` and `exception_type` are trivially copyable.
- `TrivialType`, if all of `value_type`, `error_type` and `exception_type` are trivial types.
- `LiteralType`, if all of `value_type`, `error_type` and `exception_type` are literal types.
- ~~`StandardLayoutType`~~. It is implementation defined if `basic_outcome` can be used by C.
However all of the three major compilers MSVC, GCC and clang implement C layout of `basic_outcome` as follows:
```c++
struct outcome_layout {
struct trivially_copyable_result_layout {
union {
value_type value;
error_type error;
};
unsigned int flags;
};
exception_type exception;
};
```
... if both `value_type` and `error_type` are `TriviallyCopyable`, otherwise:
```c++
struct outcome_layout {
struct non_trivially_copyable_result_layout {
value_type value;
unsigned int flags;
error_type error;
};
exception_type exception;
};
```
If you choose standard layout `value_type`, `error_type` and `exception_type`, `basic_outcome`
works fine from C on MSVC, GCC and clang.
- `EqualityComparable`, if all of `value_type`, `error_type` and `exception_type` implement equality comparisons with one another.
- ~~`LessThanComparable`~~, not implemented due to availability of implicit conversions from `value_type`, `error_type` and `exception_type`, this can cause major surprise (i.e. hard to diagnose bugs), so we don't implement these at all.
- ~~`Hash`~~, not implemented as a generic implementation of a unique hash for non-valued items which are unequal would require a dependency on RTTI being enabled.
Thus `basic_outcome` meets the `Regular` concept if all of `value_type`, `error_type` and `exception_type` are `Regular`, except for the lack of a default constructor. Often where one needs a default constructor, wrapping `basic_outcome` into {{% api "std::optional<T>" %}} will suffice.
### Public member functions
#### Disabling constructors
{{% children description="true" depth="2" categories="disabling-constructors" %}}
#### Copy and move constructors and assignment, and destructor
{{% children description="true" depth="2" categories="default-constructors,copy-constructors,move-constructors,copy-assignment,move-assignment,destructors" %}}
#### Converting constructors
{{% children description="true" depth="2" categories="converting-constructors" %}}
#### Inplace constructors
{{% children description="true" depth="2" categories="inplace-constructors" %}}
#### Tagged constructors
{{% children description="true" depth="2" categories="tagged-constructors" %}}
#### Observers
{{% children description="true" depth="2" categories="observers" %}}
#### Modifiers
{{% children description="true" depth="2" categories="modifiers" %}}
#### Comparisons
See above for why `LessThanComparable` is not implemented.
{{% children description="true" depth="2" categories="comparisons" %}}
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/equality_success_type.md | +++
title = "`bool operator!=(const success_type<A> &) const`"
description = "Returns true if this outcome does not compare equal to the success type sugar. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 850
+++
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" %}}.
*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`.
*Complexity*: Whatever the underlying `operator!=` has. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_error_move_constructor.md | +++
title = "`basic_outcome(failure_type<EC> &&)`"
description = "Implicit error-from-failure-type-sugar move constructor. Available if `predicate::enable_compatible_conversion<void, EC, void, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 530
+++
Implicit error-from-failure-type-sugar move constructor used to disambiguate the construction of the error type.
Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and `failure_type<EC> &&`.
*Requires*: `predicate::enable_compatible_conversion<void, EC, void, void>` is true.
*Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/has_value.md | +++
title = "`bool has_value() const noexcept`"
description = "Returns true if a value is present. Constexpr, never throws."
categories = ["observers"]
weight = 591
+++
Returns true if a value is present. Constexpr where possible. Alias for {{% api "explicit operator bool() const noexcept" %}}.
*Requires*: Always available.
*Complexity*: Constant time.
*Guarantees*: Never throws an exception.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/value_rvalue_const.md | +++
title = "`const value_type &&value() const &&`"
description = "Wide contract const rvalue reference observer of any value present. Constexpr propagating."
categories = ["observers"]
weight = 670
+++
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.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_value_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/has_failure.md | +++
title = "`bool has_failure() const noexcept`"
description = "Returns true if there is either an error or an exception. Constexpr, never throws."
categories = ["observers"]
weight = 595
+++
Returns true if there is either an error or an exception. Constexpr where possible.
*Requires*: Always available.
*Complexity*: Constant time.
*Guarantees*: Never throws an exception.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/exception_rvalue_const.md | +++
title = "`const exception_type &&exception() const &&`"
description = "Wide contract const rvalue reference observer of the stored exception. Constexpr propagating."
categories = ["observers"]
weight = 788
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_exception_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/error_rvalue.md | +++
title = "`error_type &&error() &&`"
description = "Wide contract rvalue reference observer of the stored error. Constexpr propagating."
categories = ["observers"]
weight = 760
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_error_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_exception_converting_constructor.md | +++
title = "`basic_outcome(P &&)`"
description = "Implicit `exception_type` constructor. Available if `predicate::enable_exception_converting_constructor<P>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "converting-constructors"]
weight = 201
+++
Implicit `exception_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `P`.
*Requires*: `predicate::enable_exception_converting_constructor<P>` is true.
*Complexity*: Same as for `exception_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_result_make_error_code_move_converting_constructor.md | +++
title = "`explicit basic_outcome(basic_result<A, B, C> &&)`"
description = "Explicit converting move constructor from compatible `basic_result`. Available if `predicate::enable_make_error_code_compatible_conversion<A, B, void, C>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "converting-constructors"]
weight = 342
+++
Explicit converting move constructor from compatible `basic_result`. Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and the input.
*Requires*: `predicate::enable_make_error_code_compatible_conversion<A, B, void, C>` is true.
*Complexity*: Same as for the move constructors of the underlying types. Constexpr, triviality and noexcept of underlying operations is propagated.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_value_lvalue.md | +++
title = "`value_type &assume_value() & noexcept`"
description = "Narrow contract lvalue reference observer of any value present. Constexpr propagating, never throws."
categories = ["observers"]
weight = 600
+++
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.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_value_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/destructor.md | +++
title = "`~basic_outcome()`"
description = "Destructor. Constexpr, triviality and noexcept propagating."
categories = ["destructors"]
weight = 150
+++
Destructor.
*Requires*: Always available.
*Complexity*: Same as for `value_type`'s, `error_type`'s and `exception_type`'s destructors. Constexpr, triviality and noexcept of underlying operations is propagated.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/exception_lvalue_const.md | +++
title = "`const exception_type &exception() const &`"
description = "Wide contract const lvalue reference observer of the stored exception. Constexpr propagating."
categories = ["observers"]
weight = 786
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_exception_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/disabling_implicit_constructor.md | +++
title = "`basic_outcome(X &&) = delete`"
description = "Disabling implicit constructor used to give useful diagnostic error when trying to use implicit constructors when `predicate::implicit_constructors_enabled` is false."
categories = ["constructors", "disabling-constructors"]
weight = 170
+++
Disabling implicit constructor used to give useful diagnostic error when trying to use implicit constructors when `predicate::implicit_constructors_enabled` is false.
*Requires*: `predicate::implicit_constructors_enabled` is false.
*Complexity*: N/A. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_error_exception_copy_constructor.md | +++
title = "`basic_outcome(const failure_type<EC, EP> &)`"
description = "Implicit error-and-exception-from-failure-type-sugar copy constructor. Available if `predicate::enable_compatible_conversion<void, EC, EP, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 536
+++
Implicit error-and-exception-from-failure-type-sugar copy constructor used to disambiguate the construction of the error + exception types.
Calls {{% api "void on_outcome_copy_construction(T *, U &&, V &&) noexcept" %}} with `this`, `const failure_type<EC> &` and `const failure_type<EP> &`.
*Requires*: `predicate::enable_compatible_conversion<void, EC, EP, void>` is true.
*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. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_exception_lvalue_const.md | +++
title = "`const exception_type &assume_exception() const & noexcept`"
description = "Narrow contract const lvalue reference observer of the stored exception. Constexpr propagating, never throws."
categories = ["observers"]
weight = 781
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/equality_failure_type.md | +++
title = "`bool operator==(const failure_type<A, B> &) const`"
description = "Returns true if this outcome compares equal to the failure type sugar. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 820
+++
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`.
*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`.
*Complexity*: Whatever the underlying `operator==` has. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/equality_basic_result.md | +++
title = "`bool operator==(const basic_result<A, B, C> &) const`"
description = "Returns true if this outcome compares equal to the other result. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 800
+++
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.
*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`.
*Complexity*: Whatever the underlying `operator==` have. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/swap.md | +++
title = "`void swap(basic_outcome &)`"
description = "Swap one basic_outcome with another, with the strong guarantee. Noexcept propagating."
categories = ["modifiers"]
weight = 900
+++
Swap one basic_outcome with another, with the strong guarantee. Constexpr if move constructors and move assignments of `value_type`, `error_type` and `exception_type` are noexcept.
*Requires*: Always available.
*Complexity*: If the move constructor and move assignment for `value_type`, `error_type` and `exception_type` are noexcept, the complexity is the same as for the `swap()` implementations of the `value_type`, `error_type` and `exception_type`. Otherwise, complexity is not preserved, as {{% api "strong_swap(bool &all_good, T &a, T &b)" %}} is used instead of `swap()`. This function defaults to using one move construction and two assignments, and it will attempt extra move assignments in order to restore the state upon entry if a failure occurs.
*Guarantees*: If an exception is thrown during the swap operation, the state of all three operands on entry is attempted to be restored, in order to implement the strong guarantee. If that too fails, the flag bits are forced to something consistent such that there can be no simultaneously valued and errored/excepted state, or valueless and errorless/exceptionless. The flag {{% api "has_lost_consistency()" %}} becomes true for both operands, which are now likely in an inconsistent state.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_error_exception_converting_constructor.md | +++
title = "`basic_outcome(S &&, P &&)`"
description = "Implicit `error_type` + `exception_type` constructor. Available if `predicate::enable_error_exception_converting_constructor<S, P>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "converting-constructors"]
weight = 202
+++
Implicit `error_type` + `exception_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&, V &&) noexcept" %}} with `this`, `S` and `P`.
*Requires*: `predicate::enable_error_exception_converting_constructor<S, P>` is true.
*Complexity*: Same as for `error_type`'s and `exception_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_error_condition_converting_constructor.md | +++
title = "`basic_outcome(ErrorCondEnum &&)`"
description = "Implicit `error_type` from `ErrorCondEnum` constructor. Available if `predicate::enable_error_condition_converting_constructor<ErrorCondEnum>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "converting-constructors"]
weight = 200
+++
Implicit `error_type` from `ErrorCondEnum` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `ErrorCondEnum`.
*Requires*: `predicate::enable_error_condition_converting_constructor<R>` is true.
*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.
*Guarantees*: If an exception is thrown during the operation, the state of the input is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/error_lvalue.md | +++
title = "`error_type &error() &`"
description = "Wide contract lvalue reference observer of the stored error. Constexpr propagating."
categories = ["observers"]
weight = 740
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_error_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_exception_rvalue_const.md | +++
title = "`const exception_type &&assume_exception() const && noexcept`"
description = "Narrow contract const rvalue reference observer of the stored exception. Constexpr propagating, never throws."
categories = ["observers"]
weight = 782
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/move_constructor.md | +++
title = "`basic_outcome(basic_outcome &&)`"
description = "Move constructor. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "move-constructors"]
weight = 110
+++
Move constructor.
*Requires*: that `value_type`, `error_type` and `exception_type` all implement a move constructor.
*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.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_result_move_converting_constructor.md | +++
title = "`explicit basic_outcome(basic_result<A, B, C> &&)`"
description = "Explicit converting move constructor from compatible `basic_result`. Available if `predicate::enable_compatible_conversion<A, B, void, C>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "converting-constructors"]
weight = 340
+++
Explicit converting move constructor from compatible `basic_result`. Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and the input.
*Requires*: `predicate::enable_compatible_conversion<A, B, void, C>` is true.
*Complexity*: Same as for the move constructors of the underlying types. Constexpr, triviality and noexcept of underlying operations is propagated.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_success_copy_constructor.md | +++
title = "`basic_outcome(const success_type<T> &)`"
description = "Implicit value-from-success-type-sugar copy constructor. Available if `predicate::enable_compatible_conversion<T, void, void>` is true, or `T` is `void`. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 500
+++
Implicit value-from-success-type-sugar copy constructor used to disambiguate the construction of the value type.
Note that if `T = void`, `value_type` will be default constructed. Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and `const success_type<T> &`.
*Requires*: `predicate::enable_compatible_conversion<T, void, void>` is true, or `T` is `void`.
*Complexity*: Same as for the `value_type` constructor which accepts `T`, or the `value_type` default constructor if `T` is `void`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_move_converting_constructor.md | +++
title = "`explicit basic_outcome(basic_outcome<A, B, C, D> &&)`"
description = "Explicit converting move constructor from compatible `basic_outcome`. Available if `predicate::enable_compatible_conversion<A, B, C, D>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "converting-constructors"]
weight = 320
+++
Explicit converting move constructor from compatible `basic_outcome`. Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and the input.
*Requires*: `predicate::enable_compatible_conversion<A, B, C, D>` is true.
*Complexity*: Same as for the move constructors of the underlying types. Constexpr, triviality and noexcept of underlying operations is propagated.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_valueorerror_converting_constructor.md | +++
title = "`explicit basic_outcome(concepts::value_or_error<T, E> &&)`"
description = "Explicit converting constructor from `concepts::value_or_error<T, E>` concept matching types. Available if `convert::value_or_error<>` permits it. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "converting-constructors"]
weight = 300
+++
Explicit converting constructor from {{% api "concepts::value_or_error<T, E>" %}} concept matching types. Delegates to the `basic_result` move constructor {{% api "explicit basic_outcome(basic_result<A, B, C> &&)" %}}.
*Requires*: `convert::`{{% api "value_or_error<T, U>" %}} has an available call operator, and if the input is a `basic_result` or `basic_outcome`, then `convert::value_or_error<>` has enabled those inputs for that `convert::value_or_error<>` specialisation.
*Complexity*: Same as for the copy or move constructor from the input's `.value()` or `.error()` respectively. Constexpr, triviality and noexcept of underlying operations is propagated.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/error_lvalue_const.md | +++
title = "`const error_type &error() const &`"
description = "Wide contract const lvalue reference observer of the stored error. Constexpr propagating."
categories = ["observers"]
weight = 750
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_error_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_exception_move_constructor.md | +++
title = "`basic_outcome(failure_type<EP> &&)`"
description = "Implicit exception-from-failure-type-sugar move constructor. Available if `predicate::enable_compatible_conversion<void, void, EP, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 535
+++
Implicit exception-from-failure-type-sugar move constructor used to disambiguate the construction of the exception type.
Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and `failure_type<EP> &&`.
*Requires*: `predicate::enable_compatible_conversion<void, void, EP, void>` is true.
*Complexity*: Same as for the `exception_type` constructor which accepts `EP`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_exception_rvalue.md | +++
title = "`exception_type &&assume_exception() && noexcept`"
description = "Narrow contract rvalue reference observer of the stored exception. Constexpr propagating, never throws."
categories = ["observers"]
weight = 782
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_copy_converting_constructor.md | +++
title = "`explicit basic_outcome(const basic_outcome<A, B, C, D> &)`"
description = "Explicit converting copy constructor from compatible `basic_outcome`. Available if `predicate::enable_compatible_conversion<A, B, C, D>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "converting-constructors"]
weight = 310
+++
Explicit converting copy constructor from compatible `basic_outcome`. Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and the input.
*Requires*: `predicate::enable_compatible_conversion<A, B, C, D>` is true.
*Complexity*: Same as for the copy constructors of the underlying types. Constexpr, triviality and noexcept of underlying operations is propagated.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_inplace_value_constructor.md | +++
title = "`explicit basic_outcome(in_place_type_t<value_type_if_enabled>, Args ...)`"
description = "Explicit inplace value constructor. Available if `predicate::enable_inplace_value_constructor<Args ...>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "inplace-constructors"]
weight = 400
+++
Explicit inplace value constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept" %}} with `this`, `in_place_type<value_type>` and `Args ...`.
*Requires*: `predicate::enable_inplace_value_constructor<Args ...>` is true.
*Complexity*: Same as for the `value_type` constructor which accepts `Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated.
*Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_error_exception_move_constructor.md | +++
title = "`basic_outcome(failure_type<EC, EP> &&)`"
description = "Implicit error-and-exception-from-failure-type-sugar move constructor. Available if `predicate::enable_compatible_conversion<void, EC, EP, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 537
+++
Implicit error-and-exception-from-failure-type-sugar move constructor used to disambiguate the construction of the error + exception types.
Calls {{% api "void on_outcome_move_construction(T *, U &&, V &&) noexcept" %}} with `this`, `failure_type<EC> &&` and `failure_type<EP> &&`.
*Requires*: `predicate::enable_compatible_conversion<void, EC, EP, void>` is true.
*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. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_error_rvalue_const.md | +++
title = "`const error_type &&assume_error() const && noexcept`"
description = "Narrow contract const rvalue reference observer of the stored error. Constexpr propagating, never throws."
categories = ["observers"]
weight = 730
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_error_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_inplace_exception_constructor_il.md | +++
title = "`explicit basic_outcome(in_place_type_t<exception_type_if_enabled>, std::initializer_list<U>, Args ...)`"
description = "Explicit inplace exception constructor. Available if `predicate::enable_inplace_exception_constructor<std::initializer_list<U>, Args ...>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "inplace-constructors"]
weight = 435
+++
Explicit inplace exception constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept" %}} with `this`, `in_place_type<exception_type>`, `std::initializer_list<U>` and `Args ...`.
*Requires*: `predicate::enable_inplace_exception_constructor<std::initializer_list<U>, Args ...>` is true.
*Complexity*: Same as for the `exception_type` constructor which accepts `std::initializer_list<U>, Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated.
*Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_value_rvalue_const.md | +++
title = "`const value_type &&assume_value() const && noexcept`"
description = "Narrow contract const rvalue reference observer of any value present. Constexpr propagating, never throws."
categories = ["observers"]
weight = 630
+++
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.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_value_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_error_lvalue_const.md | +++
title = "`const error_type &assume_error() const & noexcept`"
description = "Narrow contract const lvalue reference observer of the stored error. Constexpr propagating, never throws."
categories = ["observers"]
weight = 710
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_error_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_error_make_error_code_copy_constructor.md | +++
title = "`basic_outcome(const failure_type<EC> &)`"
description = "Implicit error-from-failure-type-sugar copy constructor. Available if `predicate::enable_make_error_code_compatible_conversion<void, EC, void, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 531
+++
Implicit error-from-failure-type-sugar copy constructor used to disambiguate the construction of the error type.
Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and `const failure_type<EC> &`.
*Requires*: `predicate::enable_make_error_code_compatible_conversion<void, EC, void, void>` is true.
*Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_inplace_exception_constructor.md | +++
title = "`explicit basic_outcome(in_place_type_t<exception_type_if_enabled>, Args ...)`"
description = "Explicit inplace exception constructor. Available if `predicate::enable_inplace_exception_constructor<Args ...>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "inplace-constructors"]
weight = 434
+++
Explicit inplace exception constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept" %}} with `this`, `in_place_type<exception_type>` and `Args ...`.
*Requires*: `predicate::enable_inplace_exception_constructor<Args ...>` is true.
*Complexity*: Same as for the `exception_type` constructor which accepts `Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated.
*Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/copy_assignment.md | +++
title = "`basic_outcome &operator=(const basic_outcome &)`"
description = "Copy assignment. Constexpr, triviality and noexcept propagating."
categories = ["operators", "assignment", "copy-assignment"]
weight = 140
+++
Copy assignment.
*Requires*: that `value_type`, `error_type` and `exception_type` all implement copy assignment.
*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.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/default.md | +++
title = "`basic_outcome() = delete`"
description = "The default constructor (disabled)."
categories = ["constructors", "implicit-constructors", "default-constructors"]
weight = 100
+++
The default constructor for basic outcome is always disabled.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/inequality_basic_outcome.md | +++
title = "`bool operator!=(const basic_outcome<A, B, C, D> &) const`"
description = "Returns true if this outcome does not compare equal to the other outcome. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 846
+++
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.
*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`.
*Complexity*: Whatever the underlying `operator!=` have. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/value_rvalue.md | +++
title = "`value_type &&value() &&`"
description = "Wide contract rvalue reference observer of any value present. Constexpr propagating."
categories = ["observers"]
weight = 660
+++
Wide contract rvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_value_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/inequality_basic_result.md | +++
title = "`bool operator!=(const basic_result<A, B, C> &) const`"
description = "Returns true if this outcome does not compare equal to the other result. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 845
+++
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.
*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`.
*Complexity*: Whatever the underlying `operator!=` have. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_inplace_error_constructor_il.md | +++
title = "`explicit basic_outcome(in_place_type_t<error_type_if_enabled>, std::initializer_list<U>, Args ...)`"
description = "Explicit inplace error constructor. Available if `predicate::enable_inplace_error_constructor<std::initializer_list<U>, Args ...>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "inplace-constructors"]
weight = 430
+++
Explicit inplace error constructor. Calls {{% api "void on_outcome_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept" %}} with `this`, `in_place_type<error_type>`, `std::initializer_list<U>` and `Args ...`.
*Requires*: `predicate::enable_inplace_error_constructor<std::initializer_list<U>, Args ...>` is true.
*Complexity*: Same as for the `error_type` constructor which accepts `std::initializer_list<U>, Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated.
*Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_error_rvalue.md | +++
title = "`error_type &&assume_error() && noexcept`"
description = "Narrow contract rvalue reference observer of the stored error. Constexpr propagating, never throws."
categories = ["observers"]
weight = 720
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_error_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/as_failure_rvalue.md | +++
title = "`failure_type<error_type, exception_type> as_failure() &&`"
description = "Return the output from free function `failure()` containing a move of any errored and/or excepted state."
categories = ["modifiers"]
weight = 920
+++
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" %}}.
*Requires*: Always available.
*Complexity*: Whatever that of `error_type`'s and/or `exception_type`'s move constructor is.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/error_rvalue_const.md | +++
title = "`const error_type &&error() const &&`"
description = "Wide contract const rvalue reference observer of the stored error. Constexpr propagating."
categories = ["observers"]
weight = 770
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_error_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_value_lvalue_const.md | +++
title = "`const value_type &assume_value() const & noexcept`"
description = "Narrow contract const lvalue reference observer of any value present. Constexpr propagating, never throws."
categories = ["observers"]
weight = 610
+++
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.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_value_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/exception_rvalue.md | +++
title = "`exception_type &&exception() &&`"
description = "Wide contract rvalue reference observer of the stored exception. Constexpr propagating."
categories = ["observers"]
weight = 787
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_exception_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_exception_lvalue.md | +++
title = "`exception_type &assume_exception() & noexcept`"
description = "Narrow contract lvalue reference observer of the stored exception. Constexpr propagating, never throws."
categories = ["observers"]
weight = 780
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_exception_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_result_make_error_code_copy_converting_constructor.md | +++
title = "`explicit basic_outcome(const basic_result<A, B, C> &)`"
description = "Explicit converting copy constructor from compatible `basic_result`. Available if `predicate::enable_make_error_code_compatible_conversion<A, B, void, C>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "converting-constructors"]
weight = 341
+++
Explicit converting copy constructor from compatible `basic_result`. Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and the input.
*Requires*: `predicate::enable_make_error_code_compatible_conversion<A, B, void, C>` is true.
*Complexity*: Same as for the copy constructors of the underlying types. Constexpr, triviality and noexcept of underlying operations is propagated.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/value_lvalue.md | +++
title = "`value_type &value() &`"
description = "Wide contract lvalue reference observer of any value present. Constexpr propagating."
categories = ["observers"]
weight = 640
+++
Wide contract lvalue reference observer of any value present. `NoValuePolicy::wide_value_check()` is first invoked, then the reference to the value is returned.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_value_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/as_failure_lvalue.md | +++
title = "`failure_type<error_type, exception_type> as_failure() const &`"
description = "Return the output from free function `failure()` containing a copy of any errored and/or excepted state."
categories = ["observers"]
weight = 910
+++
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" %}}.
*Requires*: Always available.
*Complexity*: Whatever that of `error_type`'s and/or `exception_type`'s copy constructor is.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/failure.md | +++
title = "`exception_type failure() const noexcept`"
description = "Synthesising observer of the stored exception or error. Available if the traits `is_error_code_available<T>` and `is_exception_ptr_available<T>` are both true. Never throws."
categories = ["observers"]
weight = 790
+++
Synthesising observer of the stored exception or error. If an exception is available,
returns a copy of that directly. If an error is available, and not an exception, an
ADL discovered free function {{% api "auto basic_outcome_failure_exception_from_error(const EC &)" %}}
is invoked. Default overloads for this function are defined in Outcome for {{% api "std::error_code" %}}
and `boost::system::error_code`, these return `std::make_exception_ptr(std::system_error(ec))`
and `boost::copy_exception(boost::system::system_error(ec))` respectively.
*Requires*: Both the traits {{% api "is_error_code_available<T>" %}} and
{{% api "is_exception_ptr_available<T>" %}} are true.
*Complexity*: Depends on `basic_outcome_failure_exception_from_error(const EC &)`.
*Guarantees*: Never throws. If an exception is thrown during the copy of the exception,
that exception (from `std::current_exception()`) is returned instead.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/has_error.md | +++
title = "`bool has_error() const noexcept`"
description = "Returns true if an error is present. Constexpr, never throws."
categories = ["observers"]
weight = 592
+++
Returns true if an error is present. Constexpr where possible.
*Requires*: Always available.
*Complexity*: Constant time.
*Guarantees*: Never throws an exception.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_exception_copy_constructor.md | +++
title = "`basic_outcome(const failure_type<EP> &)`"
description = "Implicit exception-from-failure-type-sugar copy constructor. Available if `predicate::enable_compatible_conversion<void, void, EP, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 534
+++
Implicit exception-from-failure-type-sugar copy constructor used to disambiguate the construction of the exception type.
Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and `const failure_type<EP> &`.
*Requires*: `predicate::enable_compatible_conversion<void, void, EP, void>` is true.
*Complexity*: Same as for the `exception_type` constructor which accepts `EP`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/assume_error_lvalue.md | +++
title = "`error_type &assume_error() & noexcept`"
description = "Narrow contract lvalue reference observer of the stored error. Constexpr propagating, never throws."
categories = ["observers"]
weight = 700
+++
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.
Note that if `error_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_error_check()`.
*Guarantees*: An exception is never thrown.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_error_make_error_code_move_constructor.md | +++
title = "`basic_outcome(failure_type<EC> &&)`"
description = "Implicit error-from-failure-type-sugar move constructor. Available if `predicate::enable_make_error_code_compatible_conversion<void, EC, void, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 532
+++
Implicit error-from-failure-type-sugar move constructor used to disambiguate the construction of the error type.
Calls {{% api "void on_outcome_move_construction(T *, U &&) noexcept" %}} with `this` and `failure_type<EC> &&`.
*Requires*: `predicate::enable_make_error_code_compatible_conversion<void, EC, void, void>` is true.
*Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/copy_constructor.md | +++
title = "`basic_outcome(const basic_outcome &)`"
description = "Copy constructor. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "copy-constructors"]
weight = 120
+++
Copy constructor.
*Requires*: that `value_type`, `error_type` and `exception_type` all implement a copy constructor.
*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.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/exception_lvalue.md | +++
title = "`exception_type &exception() &`"
description = "Wide contract lvalue reference observer of the stored exception. Constexpr propagating."
categories = ["observers"]
weight = 785
+++
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.
Note that if `exception_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::wide_exception_check()`.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_failure_error_copy_constructor.md | +++
title = "`basic_outcome(const failure_type<EC> &)`"
description = "Implicit error-from-failure-type-sugar copy constructor. Available if `predicate::enable_compatible_conversion<void, EC, void, void>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "tagged-constructors"]
weight = 520
+++
Implicit error-from-failure-type-sugar copy constructor used to disambiguate the construction of the error type.
Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and `const failure_type<EC> &`.
*Requires*: `predicate::enable_compatible_conversion<void, EC, void, void>` is true.
*Complexity*: Same as for the `error_type` constructor which accepts `EC`. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_inplace_value_error_exception_constructor.md | +++
title = "`basic_outcome(A1 &&, A2 &&, Args ...)`"
description = "Implicit inplace value or error or exception constructor. Available if `predicate::enable_inplace_value_error_exception_constructor<A1, A2, Args ...>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "inplace-constructors"]
weight = 440
+++
Implicit inplace value or error or exception constructor. Delegates to an appropriate explicit inplace constructor depending on input.
*Requires*: predicate::enable_inplace_value_error_exception_constructor<A1, A2, Args ...>` is true.
*Complexity*: Same as for the `value_type` or `error_type` or `exception_type` constructor which accepts `A1, A2, Args ...`. Constexpr, triviality and noexcept of underlying operations is propagated.
*Guarantees*: If an exception is thrown during the operation, the state of the Args is left indeterminate.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/has_exception.md | +++
title = "`bool has_exception() const noexcept`"
description = "Returns true if an exception is present. Constexpr, never throws."
categories = ["observers"]
weight = 593
+++
Returns true if an exception is present. Constexpr where possible.
*Requires*: Always available.
*Complexity*: Constant time.
*Guarantees*: Never throws an exception.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/implicit_error_converting_constructor.md | +++
title = "`basic_outcome(S &&)`"
description = "Implicit `error_type` constructor. Available if `predicate::enable_error_converting_constructor<S>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "implicit-constructors", "converting-constructors"]
weight = 190
+++
Implicit `error_type` constructor. Calls {{% api "void on_outcome_construction(T *, U &&) noexcept" %}} with `this` and `S`.
*Requires*: `predicate::enable_error_converting_constructor<S>` is true.
*Complexity*: Same as for `error_type`'s copy or move constructor. Constexpr, triviality and noexcept of underlying operations is propagated. |
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/explicit_result_copy_converting_constructor.md | +++
title = "`explicit basic_outcome(const basic_result<A, B, C> &)`"
description = "Explicit converting copy constructor from compatible `basic_result`. Available if `predicate::enable_compatible_conversion<A, B, void, C>` is true. Constexpr, triviality and noexcept propagating."
categories = ["constructors", "explicit-constructors", "converting-constructors"]
weight = 330
+++
Explicit converting copy constructor from compatible `basic_result`. Calls {{% api "void on_outcome_copy_construction(T *, U &&) noexcept" %}} with `this` and the input.
*Requires*: `predicate::enable_compatible_conversion<A, B, void, C>` is true.
*Complexity*: Same as for the copy constructors of the underlying types. Constexpr, triviality and noexcept of underlying operations is propagated.
*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`.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/inequality_success_type.md | +++
title = "`bool operator==(const success_type<A> &) const`"
description = "Returns true if this result compares equal to the success type sugar. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 810
+++
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" %}}.
*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`.
*Complexity*: Whatever the underlying `operator==` has. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_outcome/equality_basic_outcome.md | +++
title = "`bool operator==(const basic_outcome<A, B, C, D> &) const`"
description = "Returns true if this outcome compares equal to the other outcome. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 801
+++
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.
*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`.
*Complexity*: Whatever the underlying `operator==` have. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_result/operator_bool.md | +++
title = "`explicit operator bool() const noexcept`"
description = "Returns true if a value is present. Constexpr, never throws."
categories = ["observers"]
weight = 590
+++
Returns true if a value is present. Constexpr where possible. Alias for {{% api "bool has_value() const noexcept" %}}.
*Requires*: Always available.
*Complexity*: Constant time.
*Guarantees*: Never throws an exception.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_result/inequality_failure_type.md | +++
title = "`bool operator!=(const failure_type<A, void> &) const`"
description = "Returns true if this result does not compare equal to the failure type sugar. Constexpr and noexcept propagating."
categories = ["comparisons"]
weight = 860
+++
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" %}}.
*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`.
*Complexity*: Whatever the underlying `operator!=` has. Constexpr and noexcept of underlying operations is propagated.
*Guarantees*: None.
|
0 | repos/outcome/doc/src/content/reference/types | repos/outcome/doc/src/content/reference/types/basic_result/assume_value_rvalue.md | +++
title = "`value_type &&assume_value() && noexcept`"
description = "Narrow contract rvalue reference observer of any value present. Constexpr propagating, never throws."
categories = ["observers"]
weight = 620
+++
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.
Note that if `value_type` is `void`, only a `const` overload returning `void` is present.
*Requires*: Always available.
*Complexity*: Depends on `NoValuePolicy::narrow_value_check()`.
*Guarantees*: An exception is never thrown.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.