Success, or an error of type E, as std::expected<void, E>.
More...
#include <expected.h>
|
|
using | value_type = void |
| | There is no value.
|
|
using | error_type = E |
| | The error's type.
|
|
|
| Expected ()=default |
| | Success.
|
|
template<typename G> |
| | Expected (const Unexpected< G > &error) |
| | Holds error's error.
|
|
template<typename G> |
| | Expected (Unexpected< G > &&error) |
| | Holds error's error.
|
|
bool | has_value () const noexcept |
| | Whether it succeeded.
|
|
| operator bool () const noexcept |
| | Whether it succeeded.
|
|
void | value () const |
| | Nothing; stops the program if it holds an error.
|
|
void | operator* () const noexcept |
| | Nothing; it must have succeeded.
|
|
const E & | error () const & |
| | The error; it must hold one (stops the program if it succeeded).
|
|
E & | error () & |
| | The error; it must hold one (stops the program if it succeeded).
|
|
E && | error () && |
| | The error, moved out; it must hold one (stops the program if it succeeded).
|
|
const void * | operator-> () const |
| | The value's members; it must hold one.
|
|
void | value_or (U &&fallback) const & |
| | The value, or fallback if it holds an error.
|
|
|
void | check () const |
| | Stops the program if it holds an error.
|
|
const void * | valuePointer () const |
| | The value, asserting that there is one.
|
|
|
static QString | messageOf (const G &error) |
| | The message of an Error, for badExpectedAccess(); other error types have none.
|
|
|
std::optional< E > | m_error |
| | The error, if it failed.
|
|
std::variant< void, E > | m_v |
| | The value (index 0) or the error (index 1).
|
template<typename E>
class Sonde::Expected< void, E >
Success, or an error of type E, as std::expected<void, E>.
The documentation for this class was generated from the following file: