mrdocs::Expected<T, E>

Expected specialization for void values. Holds either success (no payload) or an unexpected error E.

Synopsis

Declared in <mrdocs/Support/Expected.hpp>

template<
    class T,
    class E>
requires std::is_void_v<T>
class Expected<T, E>;

Types

Name

Description

error_type

Error type stored when disengaged.

rebind

Rebind to another value type with the same error type.

unexpected_type

Alias for the unexpected wrapper.

value_type

Value type for this specialization (always void).

Member Functions

Name

Description

Expected [constructor]

Constructors

~Expected [destructor]

Destructors

operator= [deleted]

Assignment operators

and_then

and_then overloads

emplace

Reset to engaged state (no error).

error

error overloads

error_or

error_or overloads

has_value

Return true when the Expected holds a value.

operator*

Ensure the Expected is engaged; throws if it holds an error.

or_else

or_else overloads

swap

Swap states with another void Expected.

transform

transform overloads

transform_error

transform_error overloads

value

value overloads

operator bool

Return true when the Expected holds a value.

Data Members

Name

Description

unex_ [variant member]

Stored unexpected error.

void_ [variant member]

Placeholder for the engaged state.

Friends

Name Description

mrdocs::swap

Swap contents with another Expected.

mrdocs::operator==

Equality operator

mrdocs::operator==

Equality operator

mrdocs::Expected

A container holding an error or a value.

Created with MrDocs