Electroneum
Public Types | Public Member Functions | Private Attributes | List of all members
expect< void > Class Reference

#include <expect.h>

Public Types

using value_type = void
 
using error_type = std::error_code
 

Public Member Functions

 expect () noexcept
 Create a successful object. More...
 
 expect (std::error_code const &code) noexcept
 
 expect (expect const &)=default
 
 ~expect ()=default
 
expectoperator= (expect const &)=default
 
 operator bool () const noexcept
 
bool has_error () const noexcept
 
std::error_code error () const noexcept
 
bool equal (expect const &rhs) const noexcept
 
bool equal (std::error_code const &rhs) const noexcept
 
bool matches (std::error_condition const &rhs) const noexcept
 

Private Attributes

std::error_code code_
 

Member Typedef Documentation

◆ error_type

using expect< void >::error_type = std::error_code

◆ value_type

using expect< void >::value_type = void

Constructor & Destructor Documentation

◆ expect() [1/3]

expect< void >::expect ( )
inlinenoexcept

Create a successful object.

◆ expect() [2/3]

expect< void >::expect ( std::error_code const &  code)
inlinenoexcept

◆ expect() [3/3]

expect< void >::expect ( expect< void > const &  )
default

◆ ~expect()

expect< void >::~expect ( )
default

Member Function Documentation

◆ equal() [1/2]

bool expect< void >::equal ( expect< void > const &  rhs) const
inlinenoexcept
Returns
error() == rhs.error().

◆ equal() [2/2]

bool expect< void >::equal ( std::error_code const &  rhs) const
inlinenoexcept
Returns
has_error() && error() == rhs.

◆ error()

std::error_code expect< void >::error ( ) const
inlinenoexcept
Returns
Error - alway

◆ has_error()

bool expect< void >::has_error ( ) const
inlinenoexcept
Returns
True if this is storing an error instead of a value.

◆ matches()

bool expect< void >::matches ( std::error_condition const &  rhs) const
inlinenoexcept
Returns
False if has_value(), otherwise error() == rhs.

◆ operator bool()

expect< void >::operator bool ( ) const
inlineexplicitnoexcept
Returns
True if this is storing a value instead of an error.

◆ operator=()

expect& expect< void >::operator= ( expect< void > const &  )
default

Member Data Documentation

◆ code_

std::error_code expect< void >::code_
private

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