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 100 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 ()
 
const E & error () const
 
 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 () &
 Return reference to the value or throws bad_expected_access if it's not available.
 
void && value () &&
 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 &
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
E & error ()
 Return reference to the error value or throws bad_expected_access if it's not available.
 
const 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.
 

Constructor & Destructor Documentation

◆ expected() [1/12]

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

Definition at line 244 of file expected.hpp.

◆ expected() [2/12]

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

Definition at line 247 of file expected.hpp.

◆ expected() [3/12]

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

Definition at line 252 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 258 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 264 of file expected.hpp.

◆ expected() [6/12]

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

Definition at line 58 of file expected.hpp.

◆ expected() [7/12]

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

Definition at line 59 of file expected.hpp.

◆ expected() [8/12]

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

Definition at line 60 of file expected.hpp.

◆ expected() [9/12]

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

Definition at line 61 of file expected.hpp.

◆ expected() [10/12]

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

Definition at line 62 of file expected.hpp.

◆ expected() [11/12]

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

Definition at line 65 of file expected.hpp.

◆ expected() [12/12]

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

Definition at line 68 of file expected.hpp.

Member Function Documentation

◆ error() [1/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 90 of file expected.hpp.

◆ error() [2/4]

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

Definition at line 286 of file expected.hpp.

◆ error() [3/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 93 of file expected.hpp.

◆ error() [4/4]

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

Definition at line 295 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 71 of file expected.hpp.

◆ has_value() [2/2]

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

Definition at line 269 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 74 of file expected.hpp.

◆ operator bool() [2/2]

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

Definition at line 274 of file expected.hpp.

◆ value() [1/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 79 of file expected.hpp.

◆ value() [2/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 82 of file expected.hpp.

◆ value() [3/4]

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

Definition at line 279 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 85 of file expected.hpp.


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