userver: utils::expected< void, E > Class Template Reference
Loading...
Searching...
No Matches
utils::expected< void, E > Class Template Reference

Detailed Description

template<class E>
class utils::expected< void, E >

Definition at line 102 of file expected.hpp.

Public Member Functions

 expected (const unexpected< E > &error)
 
 expected (unexpected< E > &&error)
 
template<class G, typename = std::enable_if_t<std::is_convertible_v<G, E>>>
 expected (const unexpected< G > &error)
 
template<class G, typename = std::enable_if_t<std::is_convertible_v<G, E>>>
 expected (unexpected< G > &&error)
 
bool has_value () const noexcept
 
 operator bool () const noexcept
 
void value () const
 
E & error () USERVER_IMPL_LIFETIME_BOUND
 
const E & error () const USERVER_IMPL_LIFETIME_BOUND
 
 expected (const void &success)
 
 expected (void &&success)
 
 expected (const unexpected< E > &error)
 
 expected (unexpected< E > &&error)
 
 expected (const unexpected< G > &error)
 
 expected (unexpected< G > &&error)
 
bool has_value () const noexcept
 Check whether *this contains an expected value.
 
 operator bool () const noexcept
 Check whether *this contains an expected value.
 
void & value () &USERVER_IMPL_LIFETIME_BOUND
 Return reference to the value or throws bad_expected_access if it's not available.
 
void && value () &&USERVER_IMPL_LIFETIME_BOUND
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const void & value () const &USERVER_IMPL_LIFETIME_BOUND
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
E & error () USERVER_IMPL_LIFETIME_BOUND
 Return reference to the error value or throws bad_expected_access if it's not available.
 
const E & error () const USERVER_IMPL_LIFETIME_BOUND
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Constructor & Destructor Documentation

◆ expected() [1/12]

template<class E>
utils::expected< void, E >::expected ( )
constexprnoexcept

Definition at line 246 of file expected.hpp.

◆ expected() [2/12]

template<class E>
utils::expected< void, E >::expected ( const unexpected< E > & error)

Definition at line 249 of file expected.hpp.

◆ expected() [3/12]

template<class E>
utils::expected< void, E >::expected ( unexpected< E > && error)

Definition at line 254 of file expected.hpp.

◆ expected() [4/12]

template<class E>
template<class G, typename>
utils::expected< void, E >::expected ( const unexpected< G > & error)

Definition at line 260 of file expected.hpp.

◆ expected() [5/12]

template<class E>
template<class G, typename>
utils::expected< void, E >::expected ( unexpected< G > && error)

Definition at line 266 of file expected.hpp.

◆ expected() [6/12]

utils::expected< void, E >::expected ( )
constexpr

Definition at line 60 of file expected.hpp.

◆ expected() [7/12]

utils::expected< void, E >::expected ( const void & success)

Definition at line 61 of file expected.hpp.

◆ expected() [8/12]

utils::expected< void, E >::expected ( void && success)

Definition at line 62 of file expected.hpp.

◆ expected() [9/12]

utils::expected< void, E >::expected ( const unexpected< E > & error)

Definition at line 63 of file expected.hpp.

◆ expected() [10/12]

utils::expected< void, E >::expected ( unexpected< E > && error)

Definition at line 64 of file expected.hpp.

◆ expected() [11/12]

utils::expected< void, E >::expected ( const unexpected< G > & error)

Definition at line 67 of file expected.hpp.

◆ expected() [12/12]

utils::expected< void, E >::expected ( unexpected< G > && error)

Definition at line 70 of file expected.hpp.

Member Function Documentation

◆ error() [1/4]

const E & utils::expected< void, E >::error ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 95 of file expected.hpp.

◆ error() [2/4]

template<class E>
const E & utils::expected< void, E >::error ( ) const

Definition at line 297 of file expected.hpp.

◆ error() [3/4]

E & utils::expected< void, E >::error ( )

Return reference to the error value or throws bad_expected_access if it's not available.

Exceptions
utils::bad_expected_accessif success value is not available

Definition at line 92 of file expected.hpp.

◆ error() [4/4]

template<class E>
E & utils::expected< void, E >::error ( )

Definition at line 288 of file expected.hpp.

◆ has_value() [1/2]

bool utils::expected< void, E >::has_value ( ) const
noexcept

Check whether *this contains an expected value.

Definition at line 73 of file expected.hpp.

◆ has_value() [2/2]

template<class E>
bool utils::expected< void, E >::has_value ( ) const
noexcept

Definition at line 271 of file expected.hpp.

◆ operator bool() [1/2]

utils::expected< void, E >::operator bool ( ) const
explicitnoexcept

Check whether *this contains an expected value.

Definition at line 76 of file expected.hpp.

◆ operator bool() [2/2]

template<class E>
utils::expected< void, E >::operator bool ( ) const
explicitnoexcept

Definition at line 276 of file expected.hpp.

◆ value() [1/4]

void && utils::expected< void, E >::value ( ) &&

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 84 of file expected.hpp.

◆ value() [2/4]

void & utils::expected< void, E >::value ( ) &

Return reference to the value or throws bad_expected_access if it's not available.

Exceptions
utils::bad_expected_accessif *this contain an unexpected value

Definition at line 81 of file expected.hpp.

◆ value() [3/4]

template<class E>
void utils::expected< void, E >::value ( ) const

Definition at line 281 of file expected.hpp.

◆ value() [4/4]

const void & utils::expected< void, E >::value ( ) const &

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 87 of file expected.hpp.


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