MySQL 8.4.0
Source Code Documentation
stdx::expected< T, E > Class Template Reference

#include <expected.h>

Public Types

using value_type = T
 
using error_type = E
 
using unexpected_type = unexpected< E >
 

Public Member Functions

constexpr expected () noexcept
 
constexpr expected (const expected &other)=default
 
constexpr expected (const expected &other)
 
constexpr expected (expected &&other)=default
 
constexpr expected (expected &&other) noexcept((std::is_nothrow_move_constructible_v< T >))
 
template<class U , class G , class UF = std::add_lvalue_reference_t<const U>, class GF = const G &>
constexpr explicit (constructor_is_explicit< UF, GF >) expected(const expected< U
 

Public Attributes

constexpr G & rhs: dummy_()
 
constexpr G has_value_
 
bool has_value_
 

Static Public Attributes

template<class UF , class GF >
static constexpr bool constructor_is_explicit
 
template<class U , class G , class UF , class GF >
static constexpr bool can_value_convert_construct
 

Member Typedef Documentation

◆ error_type

template<class T , class E >
using stdx::expected< T, E >::error_type = E

◆ unexpected_type

template<class T , class E >
using stdx::expected< T, E >::unexpected_type = unexpected<E>

◆ value_type

template<class T , class E >
using stdx::expected< T, E >::value_type = T

Constructor & Destructor Documentation

◆ expected() [1/5]

template<class T , class E >
constexpr stdx::expected< T, E >::expected ( )
inlineconstexprnoexcept

◆ expected() [2/5]

template<class T , class E >
constexpr stdx::expected< T, E >::expected ( const expected< T, E > &  other)
constexprdefault

◆ expected() [3/5]

template<class T , class E >
constexpr stdx::expected< T, E >::expected ( const expected< T, E > &  other)
inlineconstexpr

◆ expected() [4/5]

template<class T , class E >
constexpr stdx::expected< T, E >::expected ( expected< T, E > &&  other)
constexprdefault

◆ expected() [5/5]

template<class T , class E >
constexpr stdx::expected< T, E >::expected ( expected< T, E > &&  other)
inlineconstexprnoexcept

Member Function Documentation

◆ explicit()

template<class T , class E >
template<class U , class G , class UF = std::add_lvalue_reference_t<const U>, class GF = const G &>
constexpr stdx::expected< T, E >::explicit ( constructor_is_explicit< UF, GF >  ) const
constexpr

Member Data Documentation

◆ can_value_convert_construct

template<class T , class E >
template<class U , class G , class UF , class GF >
constexpr bool stdx::expected< T, E >::can_value_convert_construct
staticconstexpr
Initial value:
=
(std::is_void_v<U> && std::is_constructible_v<E, GF> &&
!std::is_constructible_v<unexpected<E>, expected<U, G> &> &&
!std::is_constructible_v<unexpected<E>, expected<U, G>> &&
!std::is_constructible_v<unexpected<E>, const expected<U, G> &> &&
!std::is_constructible_v<unexpected<E>, const expected<U, G>>)

◆ constructor_is_explicit

template<class T , class E >
template<class UF , class GF >
constexpr bool stdx::expected< T, E >::constructor_is_explicit
staticconstexpr
Initial value:
=
(!std::is_convertible_v<UF, T> || !std::is_convertible_v<GF, E>)

◆ has_value_ [1/2]

template<class T , class E >
constexpr G stdx::expected< T, E >::has_value_
Initial value:
{rhs.has_value()} {
if (!rhs.has_value()) {
std::construct_at(std::addressof(unex_), rhs.error());
}
}
template <class U, class G, class UF = U, class GF = G>
constexpr explicit(constructor_is_explicit<UF, GF>)
expected(expected<U, G> &&rhs)
requires can_value_convert_construct<U, G, UF, GF>
: dummy_()
constexpr G & rhs
Definition: expected.h:956
constexpr expected() noexcept
Definition: expected.h:911

◆ has_value_ [2/2]

template<class T , class E >
bool stdx::expected< T, E >::has_value_

◆ rhs

template<class T , class E >
constexpr G& stdx::expected< T, E >::rhs

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