CppWAMP
C++11 client library for the WAMP protocol
wamp::Unexpected< E > Class Template Reference

Minimalistic implementation of std::unexpected<std::error_code>. More...

#include <cppwamp/erroror.hpp>

Public Types

using error_type = E
 Type representing errors.
 

Public Member Functions

 Unexpected (error_type error) noexcept
 Constructor taking an error value.
 
error_typevalue () &noexcept
 Accesses the error value.
 
error_type && value () &&noexcept
 Moves the error value.
 
const error_typevalue () const &noexcept
 Accesses the error value.
 
const error_type && value () const &&noexcept
 Moves the error value.
 
void swap (Unexpected &other) noexcept(std::is_nothrow_swappable< E >::value)
 Swaps contents with another UnexpectedError.
 

Related Functions

(Note that these are not member functions.)

template<typename E1 , typename E2 >
bool operator== (const Unexpected< E1 > &x, const Unexpected< E2 > &y)
 Equality comparison.
 
template<typename E1 , typename E2 >
bool operator!= (const Unexpected< E1 > &x, const Unexpected< E2 > &y)
 Inequality comparison.
 
template<typename E >
void swap (Unexpected< E > &x, Unexpected< E > &y) noexcept(noexcept(x.swap(y)))
 Non-member swap.
 
template<typename E >
constexpr Unexpected< ValueTypeOf< E > > makeUnexpected (E &&error)
 Non-standard factory function needed in C++11 due to lack of CTAD.
 

Detailed Description

template<typename E>
class wamp::Unexpected< E >

Minimalistic implementation of std::unexpected<std::error_code>.

This wrapper type is used to initialize an ErrorOr with an error in an unambiguous manner.

See also
ErrorOr

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