|
| | hxexpected (void) |
| | hxexpected (hxnil_t) |
| | hxexpected (const hxexpected &x_) noexcept |
| | hxexpected (hxexpected &&x_) noexcept |
| template<typename error_t_ = E_, typename... args_t_, hxenable_if_t< !hxis_hxexpected_< hxremove_cvref_t< error_t_ > >::value, bool > = true> |
| | hxexpected (error_t_ &&error_, args_t_ &&... args_) noexcept |
| | ~hxexpected (void) |
| const T & | operator* (void) const |
| T & | operator* (void) |
| const T * | operator-> (void) const |
| T * | operator-> (void) |
| | operator bool (void) const |
| hxexpected & | operator= (const hxexpected &x_) noexcept |
| hxexpected & | operator= (hxexpected &&x_) noexcept |
| hxexpected & | operator= (hxnil_t) |
| template<typename U_ = T, hxenable_if_t< !hxis_hxexpected_< hxremove_cvref_t< U_ > >::value &&!hxis_same< hxremove_cvref_t< U_ >, E_ >(), bool > = true> |
| hxexpected & | operator= (U_ &&value_) noexcept |
| bool | operator== (const hxexpected &x_) const |
| bool | operator== (hxnil_t) const |
| bool | operator== (const T &value_) const |
| template<typename self_t_, typename callable_t_> |
| auto | and_then (this self_t_ &&self_, callable_t_ &&callable_) -> hxremove_cvref_t< decltype(hxforward< callable_t_ >(callable_)(hxforward_like< self_t_ >(hxdeclval< T & >())))> |
| template<typename... args_t_> |
| T & | emplace (args_t_ &&... args_) noexcept |
| bool | equal (const hxexpected &x_) const |
| template<typename self_t_> |
| auto | error (this self_t_ &&self_) -> decltype(hxforward_like< self_t_ >(hxdeclval< E_ & >())) |
| bool | has_value (void) const |
| hxhash_t | hash (void) const |
| template<typename self_t_, typename callable_t_> |
| hxexpected | or_else (this self_t_ &&self_, callable_t_ &&callable_) |
| void | reset (void) noexcept |
| void | reset (const E_ &error_) noexcept |
| void | swap (hxexpected &x_) noexcept |
| template<typename self_t_> |
| auto | value (this self_t_ &&self_) -> decltype(hxforward_like< self_t_ >(hxdeclval< T & >())) |
| template<typename self_t_, typename... args_t_> |
| T | value_or (this self_t_ &&self_, args_t_ &&... args_) |
template<hxexpected_concept_ T, hxunexpected_concept_ E_>
class hxexpected< T, E_ >
hxexpected<T, E=bool> - Holds either a value of type T or an error of type E.
Implements std::expected<T, E>. A false equivalent error means the value is valid and a true equivalent error means the value is uninitialized storage. E defaults to bool.
- T : The contained value type. Must not be a reference or pointer type. Use hxref<T> for reference or pointer types.
- E : The error type. Must support static_cast<bool>.
template<hxexpected_concept_ T, hxunexpected_concept_ E_>
template<typename self_t_, typename callable_t_>
Returns the result of calling callable with the contained value when there is no error, otherwise returns hxnil.
Use and_then to return hxptr, hxref or hxexpected.
- callable : The function to call with the contained value.
template<hxexpected_concept_ T, hxunexpected_concept_ E_>
template<typename self_t_, typename... args_t_>
| T hxexpected< T, E_ >::value_or |
( |
this self_t_ && | self_, |
|
|
args_t_ &&... | args_ ) |
Returns the contained value if non-null, otherwise returns a T constructed from args.
- args : The arguments used to construct the value when an error is present.