Loading...
Searching...
No Matches
etl::expected< void, TError > Class Template Reference

Specialisation for void value type. More...

`#include <expected.h>`

## Public Types

typedef etl::expected< void, TError > | this_type
typedef void | value_type
typedef TError | error_type
typedef etl::unexpected< TError > | unexpected_type

## Public Member Functions

ETL_CONSTEXPR14 | expected ()
| Default constructor.
ETL_CONSTEXPR14 | expected (const unexpected_type &ue_)
| Copy construct from unexpected.
ETL_CONSTEXPR14 | expected (const this_type &other)
| Copy construct.
this_type & | operator= (const this_type &other)
| Copy assign.
expected & | operator= (const unexpected_type &ue)
| Copy assign from unexpected.
ETL_NODISCARD ETL_CONSTEXPR14 bool | has_value () const ETL_NOEXCEPT
| Returns true if expected has a value.
ETL_NODISCARD ETL_CONSTEXPR14 ETL_EXPLICIT | operator bool () const ETL_NOEXCEPT
| Returns true if expected has a value.
const error_type & | error () const
template<typename G>
error_type | error_or (const G &default_error) const
| Get the error or a default value.
void | swap (this_type &other)
| Swap with another etl::expected.
const value_type & | value () const
| Get the value.
value_type | value_or (const U &default_value) const
value_type * | operator-> ()
value_type & | operator* () ETL_LVALUE_REF_QUALIFIER
ETL_NODISCARD ETL_CONSTEXPR14 value_type * | begin () ETL_NOEXCEPT
ETL_NODISCARD ETL_CONSTEXPR14 value_type * | end () ETL_NOEXCEPT
| Returns a pointer past the value if has_value(), otherwise returns nullptr.

## Detailed Description

template<typename TError>
class etl::expected< void, TError >

Specialisation for void value type.

## Member Function Documentation

## begin()

ETL_NODISCARD ETL_CONSTEXPR14 value_type * etl::expected< void, TError >::begin | ( |  | ) |

inline

Returns a pointer to the value if has_value(), otherwise returns nullptr. Allows expected to be used as a range of 0 or 1 elements.

## error()

template<typename TError>

const error_type & etl::expected< void, TError >::error | ( |  | ) | const

inline

Returns the error Undefined behaviour if an error has not been set.

The documentation for this class was generated from the following file:

- include/etl/expected.h