Represents the result of a computation which can either complete successfully with an instance of type T
or fail with an error
.
More...
|
template<class U , class = std::enable_if_t<std::is_convertible_v<U, T> || is_error_code_enum_v<U>>> |
| expected (U x) |
|
| expected (T &&x) noexcept(nothrow_move) |
|
| expected (const T &x) noexcept(nothrow_copy) |
|
| expected (caf::error e) noexcept |
|
| expected (const expected &other) noexcept(nothrow_copy) |
|
| expected (expected &&other) noexcept(nothrow_move) |
|
template<class... Ts> |
| expected (std::in_place_t, Ts &&... xs) |
|
expected & | operator= (const expected &other) noexcept(nothrow_copy) |
|
expected & | operator= (expected &&other) noexcept(nothrow_move) |
|
expected & | operator= (const T &x) noexcept(nothrow_copy) |
|
expected & | operator= (T &&x) noexcept(nothrow_move) |
|
template<class U > |
std::enable_if_t< std::is_convertible_v< U, T >, expected & > | operator= (U x) |
|
expected & | operator= (caf::error e) noexcept |
|
template<class Enum , class = std::enable_if_t<is_error_code_enum_v<Enum>>> |
expected & | operator= (Enum code) |
|
| operator bool () const noexcept |
| Returns true if the object holds a value (is engaged).
|
|
bool | has_value () const noexcept |
| Returns true if the object holds a value (is engaged).
|
|
bool | engaged () const noexcept |
| Returns true if the object holds a value (is engaged).
|
|
template<class... Args> |
std::enable_if_t< std::is_nothrow_constructible_v< T, Args... >, T & > | emplace (Args &&... args) noexcept |
|
void | swap (expected &other) noexcept(nothrow_move &¬hrow_swap) |
|
const T & | cvalue () const noexcept |
| Returns the contained value.
|
|
T & | value () & |
| Returns the contained value.
|
|
const T & | value () const & |
| Returns the contained value.
|
|
T && | value () && |
| Returns the contained value.
|
|
const T && | value () const && |
| Returns the contained value.
|
|
template<class U > |
T | value_or (U &&fallback) const & |
| Returns the contained value if there is one, otherwise returns fallback .
|
|
template<class U > |
T | value_or (U &&fallback) && |
| Returns the contained value if there is one, otherwise returns fallback .
|
|
T & | operator* () &noexcept |
| Returns the contained value.
|
|
const T & | operator* () const &noexcept |
| Returns the contained value.
|
|
T && | operator* () &&noexcept |
| Returns the contained value.
|
|
const T && | operator* () const &&noexcept |
| Returns the contained value.
|
|
T * | operator-> () noexcept |
| Returns the contained value.
|
|
const T * | operator-> () const noexcept |
| Returns the contained value.
|
|
const caf::error & | cerror () const noexcept |
| Returns the contained error.
|
|
caf::error & | error () &noexcept |
| Returns the contained error.
|
|
const caf::error & | error () const &noexcept |
| Returns the contained error.
|
|
caf::error && | error () &&noexcept |
| Returns the contained error.
|
|
const caf::error && | error () const &&noexcept |
| Returns the contained error.
|
|
template<class F > |
auto | and_then (F &&f) & |
|
template<class F > |
auto | and_then (F &&f) && |
|
template<class F > |
auto | and_then (F &&f) const & |
|
template<class F > |
auto | and_then (F &&f) const && |
|
template<class F > |
expected | or_else (F &&f) & |
|
template<class F > |
expected | or_else (F &&f) && |
|
template<class F > |
expected | or_else (F &&f) const & |
|
template<class F > |
expected | or_else (F &&f) const && |
|
template<class F > |
auto | transform (F &&f) & |
|
template<class F > |
auto | transform (F &&f) && |
|
template<class F > |
auto | transform (F &&f) const & |
|
template<class F > |
auto | transform (F &&f) const && |
|
template<class F > |
expected | transform_or (F &&f) & |
|
template<class F > |
expected | transform_or (F &&f) && |
|
template<class F > |
expected | transform_or (F &&f) const & |
|
template<class F > |
expected | transform_or (F &&f) const && |
|
|
(Note that these are not member symbols.)
|
template<class T > |
auto | operator== (const expected< T > &x, const expected< T > &y) -> decltype(*x==*y) |
|
template<class T , class U > |
auto | operator== (const expected< T > &x, const U &y) -> decltype(*x==y) |
|
template<class T , class U > |
auto | operator== (const T &x, const expected< U > &y) -> decltype(x==*y) |
|
template<class T > |
bool | operator== (const expected< T > &x, const error &y) |
|
template<class T > |
bool | operator== (const error &x, const expected< T > &y) |
|
template<class T , class Enum > |
std::enable_if_t< is_error_code_enum_v< Enum >, bool > | operator== (const expected< T > &x, Enum y) |
|
template<class T , class Enum > |
std::enable_if_t< is_error_code_enum_v< Enum >, bool > | operator== (Enum x, const expected< T > &y) |
|
template<class T > |
auto | operator!= (const expected< T > &x, const expected< T > &y) -> decltype(*x==*y) |
|
template<class T , class U > |
auto | operator!= (const expected< T > &x, const U &y) -> decltype(*x==y) |
|
template<class T , class U > |
auto | operator!= (const T &x, const expected< U > &y) -> decltype(x==*y) |
|
template<class T > |
bool | operator!= (const expected< T > &x, const error &y) |
|
template<class T > |
bool | operator!= (const error &x, const expected< T > &y) |
|
template<class T , class Enum > |
std::enable_if_t< is_error_code_enum_v< Enum >, bool > | operator!= (const expected< T > &x, Enum y) |
|
template<class T , class Enum > |
std::enable_if_t< is_error_code_enum_v< Enum >, bool > | operator!= (Enum x, const expected< T > &y) |
|
bool | operator== (const expected< void > &x, const expected< void > &y) |
|
bool | operator!= (const expected< void > &x, const expected< void > &y) |
|
template<class T>
class caf::expected< T >
Represents the result of a computation which can either complete successfully with an instance of type T
or fail with an error
.
- Template Parameters
-