MySQL 8.0.39
Source Code Documentation
stdx::ExpectedImpl< T, E > Class Template Reference

#include <expected.h>

Inheritance diagram for stdx::ExpectedImpl< T, E >:
[legend]

Public Types

using value_type = T
 
using error_type = E
 
using unexpected_type = unexpected< E >
 
template<class UF , class GF >
using constructor_is_explicit = std::bool_constant<!std::is_convertible_v< UF, T >||!std::is_convertible_v< GF, E > >
 
template<class U , class G , class UF , class GF >
using can_value_convert_construct = std::bool_constant< std::is_constructible_v< T, UF > &&std::is_constructible_v< E, GF > &&!std::is_constructible_v< T, ExpectedImpl< U, G > & > &&!std::is_constructible_v< T, ExpectedImpl< U, G > > &&!std::is_constructible_v< T, const ExpectedImpl< U, G > & > &&!std::is_constructible_v< T, const ExpectedImpl< U, G > > &&!std::is_convertible_v< ExpectedImpl< U, G > &, T > &&!std::is_convertible_v< ExpectedImpl< U, G >, T > &&!std::is_convertible_v< const ExpectedImpl< U, G > &, T > &&!std::is_convertible_v< const ExpectedImpl< U, G >, T > &&!std::is_constructible_v< unexpected< E >, ExpectedImpl< U, G > & > &&!std::is_constructible_v< unexpected< E >, ExpectedImpl< U, G > > &&!std::is_constructible_v< unexpected< E >, const ExpectedImpl< U, G > & > &&!std::is_constructible_v< unexpected< E >, const ExpectedImpl< U, G > > >
 
template<class U >
using can_construct_from_value_type = std::conjunction< std::negation< std::is_same< std::in_place_t, stdx::remove_cvref_t< U > > >, std::negation< std::is_same< ExpectedImpl< T, E >, stdx::remove_cvref_t< U > > >, std::negation< std::is_same< unexpected< E >, stdx::remove_cvref_t< U > > >, std::is_constructible< T, U > >
 
template<class U >
using can_construct_from_value_type_explicit = std::negation< std::is_convertible< U, T > >
 

Public Member Functions

template<bool B = std::is_default_constructible<T>::value, std::enable_if_t< B > * = nullptr>
constexpr ExpectedImpl ()
 
template<class U , class G , class UF = const U &, class GF = const G &, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&!constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr ExpectedImpl (const ExpectedImpl< U, G > &rhs)
 
template<class U , class G , class UF = const U &, class GF = const G &, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr ExpectedImpl (const ExpectedImpl< U, G > &rhs)
 
template<class U , class G , class UF = U, class GF = G, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&!constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr ExpectedImpl (ExpectedImpl< U, G > &&rhs)
 
template<class U , class G , class UF = U, class GF = G, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr ExpectedImpl (ExpectedImpl< U, G > &&rhs)
 
template<class U = T, std::enable_if_t< can_construct_from_value_type< U >::value &&!can_construct_from_value_type_explicit< U >::value > * = nullptr>
constexpr ExpectedImpl (U &&v)
 
template<class U = T, std::enable_if_t< can_construct_from_value_type< U >::value &&can_construct_from_value_type_explicit< U >::value > * = nullptr>
constexpr ExpectedImpl (U &&v)
 
template<class... Args, std::enable_if_t< std::is_constructible_v< T, Args &&... > > * = nullptr>
constexpr ExpectedImpl (std::in_place_t, Args &&... args)
 
template<class... Args, std::enable_if_t< std::is_constructible_v< E, Args &&... > > * = nullptr>
constexpr ExpectedImpl (stdx::unexpect_t, Args &&... args)
 
constexpr ExpectedImpl (const ExpectedImpl &other)
 
constexpr ExpectedImpl (ExpectedImpl &&other) noexcept(std::is_nothrow_move_constructible< E >::value &&std::is_nothrow_move_constructible< T >::value)
 
template<class G , std::enable_if_t< std::is_constructible_v< E, const G & > > * = nullptr>
constexpr ExpectedImpl (const unexpected< G > &e)
 
template<class G , std::enable_if_t< std::is_constructible_v< E, G > > * = nullptr>
constexpr ExpectedImpl (unexpected< G > &&e)
 
ExpectedImploperator= (ExpectedImpl const &other)
 
ExpectedImploperator= (ExpectedImpl &&other)
 
template<class U = T, std::enable_if_t< !std::is_same_v< ExpectedImpl< T, E >, stdx::remove_cvref_t< U > > &&!std::conjunction_v< std::is_scalar< T >, std::is_same< T, std::decay_t< U > > > &&std::is_constructible_v< T, U > &&std::is_assignable_v< T &, U > > * = nullptr>
ExpectedImploperator= (U &&v)
 
 ~ExpectedImpl ()
 
template<class U = T, class G = E>
std::enable_if_t<(std::is_move_constructible< U >::value||std::is_move_constructible< G >::value)> swap (ExpectedImpl &other) noexcept(std::is_nothrow_move_constructible< T >::value &&std::is_nothrow_move_constructible< E >::value)
 
constexpr const value_typevalue () const &
 
constexpr const value_type && value () const &&
 
value_typevalue () &
 
value_type && value () &&
 
value_typeoperator* () &
 
constexpr const value_typeoperator* () const &
 
value_typeoperator-> ()
 
constexpr const value_typeoperator-> () const
 
template<class U >
constexpr value_type value_or (U &&v) const &
 
template<class U >
constexpr value_type value_or (U &&v) &&
 
constexpr const error_typeerror () const &
 
constexpr const error_type && error () const &&
 
constexpr error_typeerror () &
 
constexpr error_type && error () &&
 
constexpr unexpected_type get_unexpected () const
 
- Public Member Functions inherited from stdx::ExpectedImplBase
constexpr ExpectedImplBase (bool has_value) noexcept
 
constexpr bool has_value () const
 
constexpr operator bool () const noexcept
 
void swap (ExpectedImplBase &other) noexcept
 

Private Attributes

base::storage_t< T, E > storage_
 

Member Typedef Documentation

◆ can_construct_from_value_type

template<class T , class E >
template<class U >
using stdx::ExpectedImpl< T, E >::can_construct_from_value_type = std::conjunction< std::negation<std::is_same<std::in_place_t, stdx::remove_cvref_t<U> >>, std::negation<std::is_same<ExpectedImpl<T, E>, stdx::remove_cvref_t<U> >>, std::negation<std::is_same<unexpected<E>, stdx::remove_cvref_t<U> >>, std::is_constructible<T, U> >

◆ can_construct_from_value_type_explicit

template<class T , class E >
template<class U >
using stdx::ExpectedImpl< T, E >::can_construct_from_value_type_explicit = std::negation<std::is_convertible<U, T> >

◆ can_value_convert_construct

template<class T , class E >
template<class U , class G , class UF , class GF >
using stdx::ExpectedImpl< T, E >::can_value_convert_construct = std::bool_constant< std::is_constructible_v<T, UF> && std::is_constructible_v<E, GF> && !std::is_constructible_v<T, ExpectedImpl<U, G> &> && !std::is_constructible_v<T, ExpectedImpl<U, G> > && !std::is_constructible_v<T, const ExpectedImpl<U, G> &> && !std::is_constructible_v<T, const ExpectedImpl<U, G> > && !std::is_convertible_v<ExpectedImpl<U, G> &, T> && !std::is_convertible_v<ExpectedImpl<U, G>, T> && !std::is_convertible_v<const ExpectedImpl<U, G> &, T> && !std::is_convertible_v<const ExpectedImpl<U, G>, T> && !std::is_constructible_v<unexpected<E>, ExpectedImpl<U, G> &> && !std::is_constructible_v<unexpected<E>, ExpectedImpl<U, G> > && !std::is_constructible_v<unexpected<E>, const ExpectedImpl<U, G> &> && !std::is_constructible_v<unexpected<E>, const ExpectedImpl<U, G> >>

◆ constructor_is_explicit

template<class T , class E >
template<class UF , class GF >
using stdx::ExpectedImpl< T, E >::constructor_is_explicit = std::bool_constant<!std::is_convertible_v<UF, T> || !std::is_convertible_v<GF, E> >

◆ error_type

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

◆ unexpected_type

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

◆ value_type

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

Constructor & Destructor Documentation

◆ ExpectedImpl() [1/13]

template<class T , class E >
template<bool B = std::is_default_constructible<T>::value, std::enable_if_t< B > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( )
inlineconstexpr

◆ ExpectedImpl() [2/13]

template<class T , class E >
template<class U , class G , class UF = const U &, class GF = const G &, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&!constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( const ExpectedImpl< U, G > &  rhs)
inlineconstexpr

◆ ExpectedImpl() [3/13]

template<class T , class E >
template<class U , class G , class UF = const U &, class GF = const G &, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( const ExpectedImpl< U, G > &  rhs)
inlineexplicitconstexpr

◆ ExpectedImpl() [4/13]

template<class T , class E >
template<class U , class G , class UF = U, class GF = G, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&!constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( ExpectedImpl< U, G > &&  rhs)
inlineconstexpr

◆ ExpectedImpl() [5/13]

template<class T , class E >
template<class U , class G , class UF = U, class GF = G, std::enable_if_t< can_value_convert_construct< U, G, UF, GF >::value &&constructor_is_explicit< UF, GF >::value > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( ExpectedImpl< U, G > &&  rhs)
inlineexplicitconstexpr

◆ ExpectedImpl() [6/13]

template<class T , class E >
template<class U = T, std::enable_if_t< can_construct_from_value_type< U >::value &&!can_construct_from_value_type_explicit< U >::value > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( U &&  v)
inlineconstexpr

◆ ExpectedImpl() [7/13]

template<class T , class E >
template<class U = T, std::enable_if_t< can_construct_from_value_type< U >::value &&can_construct_from_value_type_explicit< U >::value > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( U &&  v)
inlineexplicitconstexpr

◆ ExpectedImpl() [8/13]

template<class T , class E >
template<class... Args, std::enable_if_t< std::is_constructible_v< T, Args &&... > > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( std::in_place_t  ,
Args &&...  args 
)
inlineconstexpr

◆ ExpectedImpl() [9/13]

template<class T , class E >
template<class... Args, std::enable_if_t< std::is_constructible_v< E, Args &&... > > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( stdx::unexpect_t  ,
Args &&...  args 
)
inlineconstexpr

◆ ExpectedImpl() [10/13]

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

◆ ExpectedImpl() [11/13]

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

◆ ExpectedImpl() [12/13]

template<class T , class E >
template<class G , std::enable_if_t< std::is_constructible_v< E, const G & > > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( const unexpected< G > &  e)
inlineconstexpr

◆ ExpectedImpl() [13/13]

template<class T , class E >
template<class G , std::enable_if_t< std::is_constructible_v< E, G > > * = nullptr>
constexpr stdx::ExpectedImpl< T, E >::ExpectedImpl ( unexpected< G > &&  e)
inlineconstexpr

◆ ~ExpectedImpl()

template<class T , class E >
stdx::ExpectedImpl< T, E >::~ExpectedImpl ( )
inline

Member Function Documentation

◆ error() [1/4]

template<class T , class E >
constexpr error_type & stdx::ExpectedImpl< T, E >::error ( ) &
inlineconstexpr

◆ error() [2/4]

template<class T , class E >
constexpr error_type && stdx::ExpectedImpl< T, E >::error ( ) &&
inlineconstexpr

◆ error() [3/4]

template<class T , class E >
constexpr const error_type & stdx::ExpectedImpl< T, E >::error ( ) const &
inlineconstexpr

◆ error() [4/4]

template<class T , class E >
constexpr const error_type && stdx::ExpectedImpl< T, E >::error ( ) const &&
inlineconstexpr

◆ get_unexpected()

template<class T , class E >
constexpr unexpected_type stdx::ExpectedImpl< T, E >::get_unexpected ( ) const
inlineconstexpr

◆ operator*() [1/2]

template<class T , class E >
value_type & stdx::ExpectedImpl< T, E >::operator* ( ) &
inline

◆ operator*() [2/2]

template<class T , class E >
constexpr const value_type & stdx::ExpectedImpl< T, E >::operator* ( ) const &
inlineconstexpr

◆ operator->() [1/2]

template<class T , class E >
value_type * stdx::ExpectedImpl< T, E >::operator-> ( )
inline

◆ operator->() [2/2]

template<class T , class E >
constexpr const value_type * stdx::ExpectedImpl< T, E >::operator-> ( ) const
inlineconstexpr

◆ operator=() [1/3]

template<class T , class E >
ExpectedImpl & stdx::ExpectedImpl< T, E >::operator= ( ExpectedImpl< T, E > &&  other)
inline

◆ operator=() [2/3]

template<class T , class E >
ExpectedImpl & stdx::ExpectedImpl< T, E >::operator= ( ExpectedImpl< T, E > const &  other)
inline

◆ operator=() [3/3]

template<class T , class E >
template<class U = T, std::enable_if_t< !std::is_same_v< ExpectedImpl< T, E >, stdx::remove_cvref_t< U > > &&!std::conjunction_v< std::is_scalar< T >, std::is_same< T, std::decay_t< U > > > &&std::is_constructible_v< T, U > &&std::is_assignable_v< T &, U > > * = nullptr>
ExpectedImpl & stdx::ExpectedImpl< T, E >::operator= ( U &&  v)
inline

◆ swap()

template<class T , class E >
template<class U = T, class G = E>
std::enable_if_t<(std::is_move_constructible< U >::value|| std::is_move_constructible< G >::value)> stdx::ExpectedImpl< T, E >::swap ( ExpectedImpl< T, E > &  other)
inlinenoexcept

◆ value() [1/4]

template<class T , class E >
value_type & stdx::ExpectedImpl< T, E >::value ( ) &
inline

◆ value() [2/4]

template<class T , class E >
value_type && stdx::ExpectedImpl< T, E >::value ( ) &&
inline

◆ value() [3/4]

template<class T , class E >
constexpr const value_type & stdx::ExpectedImpl< T, E >::value ( ) const &
inlineconstexpr

◆ value() [4/4]

template<class T , class E >
constexpr const value_type && stdx::ExpectedImpl< T, E >::value ( ) const &&
inlineconstexpr

◆ value_or() [1/2]

template<class T , class E >
template<class U >
constexpr value_type stdx::ExpectedImpl< T, E >::value_or ( U &&  v) &&
inlineconstexpr

◆ value_or() [2/2]

template<class T , class E >
template<class U >
constexpr value_type stdx::ExpectedImpl< T, E >::value_or ( U &&  v) const &
inlineconstexpr

Member Data Documentation

◆ storage_

template<class T , class E >
base::storage_t<T, E> stdx::ExpectedImpl< T, E >::storage_
private

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