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

Expected type. More...

`#include <expected.h>`

## Public Types

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

## Public Member Functions

ETL_CONSTEXPR14 | expected () ETL_NOEXCEPT
| Default constructor.
ETL_CONSTEXPR14 | expected (const value_type &value_) ETL_NOEXCEPT
| Constructor.
ETL_CONSTEXPR14 | expected (const expected &other) ETL_NOEXCEPT
| Copy constructor.
template<typename G>
| expected (const etl::unexpected< G > &ue)
ETL_CONSTEXPR14 | expected (etl::in_place_t) ETL_NOEXCEPT
| Construct with default value type.
this_type & | operator= (const this_type &other)
| Copy assign from etl::expected.
expected & | operator= (const value_type &value)
| Copy assign from value.
expected & | operator= (const unexpected_type &ue)
| Copy assign from unexpected.
const value_type & | value () const
| Get the value.
ETL_NODISCARD ETL_CONSTEXPR14 bool | has_value () const ETL_NOEXCEPT
ETL_NODISCARD ETL_CONSTEXPR14 ETL_EXPLICIT | operator bool () const ETL_NOEXCEPT
template<typename U>
value_type | value_or (const U &default_value) const
const error_type & | error () const
template<typename G>
error_type | error_or (const G &default_error) const
| Get the error or a default value.
value_type * | operator-> ()
const value_type * | operator-> () const
value_type & | operator* () ETL_LVALUE_REF_QUALIFIER
const value_type & | operator* () const 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.
ETL_NODISCARD ETL_CONSTEXPR14 const value_type * | begin () const ETL_NOEXCEPT
| Returns a const pointer to the value if has_value(), otherwise returns nullptr.
ETL_NODISCARD ETL_CONSTEXPR14 const value_type * | end () const ETL_NOEXCEPT
| Returns a const pointer past the value if has_value(), otherwise returns nullptr.

## Detailed Description

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

Expected type.

## Member Function Documentation

## begin()

template<typename TValue, typename TError>

ETL_NODISCARD ETL_CONSTEXPR14 value_type * etl::expected< TValue, 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.

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

- include/etl/expected.h