Result
cpp::bitwizeshift::bad_result_access< E > Class Template Reference

An exception thrown when result::value is accessed without a contained value. More...

#include <result.hpp>

+ Inheritance diagram for cpp::bitwizeshift::bad_result_access< E >:
+ Collaboration diagram for cpp::bitwizeshift::bad_result_access< E >:

Public Member Functions

template<typename E2 , typename = typename std::enable_if<std::is_constructible<E,E2>::value>::type>
 bad_result_access (E2 &&error)
 Constructs this exception using the underlying error type for the error type. More...
 
 bad_result_access (const bad_result_access &other)=default
 
 bad_result_access (bad_result_access &&other)=default
 
auto operator= (const bad_result_access &other) -> bad_result_access &=default
 
auto operator= (bad_result_access &&other) -> bad_result_access &=default
 
template<typename E2 , typename = typename std::enable_if<std::is_constructible<E,E2>::value>::type>
 bad_result_access (const char *what_arg, E2 &&error)
 Constructs this exception using the underlying error type for the error and a message. More...
 
template<typename E2 , typename = typename std::enable_if<std::is_constructible<E,E2>::value>::type>
 bad_result_access (const std::string &what_arg, E2 &&error)
 Constructs this exception using the underlying error type for the error and a message. More...
 
auto error () &noexcept -> E &
 Gets the underlying error. More...
 
auto error () &&noexcept -> E &&
 Gets the underlying error. More...
 
auto error () const &noexcept -> const E &
 Gets the underlying error. More...
 
auto error () const &&noexcept -> const E &&
 Gets the underlying error. More...
 

Detailed Description

template<typename E>
class cpp::bitwizeshift::bad_result_access< E >

An exception thrown when result::value is accessed without a contained value.

Definition at line 312 of file result.hpp.

Constructor & Destructor Documentation

◆ bad_result_access() [1/3]

template<typename E >
template<typename E2 , typename = typename std::enable_if<std::is_constructible<E,E2>::value>::type>
cpp::bitwizeshift::bad_result_access< E >::bad_result_access ( E2 &&  error)
explicit

Constructs this exception using the underlying error type for the error type.

Parameters
errorthe underlying error

◆ bad_result_access() [2/3]

template<typename E >
template<typename E2 , typename = typename std::enable_if<std::is_constructible<E,E2>::value>::type>
cpp::bitwizeshift::bad_result_access< E >::bad_result_access ( const char *  what_arg,
E2 &&  error 
)

Constructs this exception using the underlying error type for the error and a message.

Parameters
what_argthe message for the failure
errorthe underlying error

◆ bad_result_access() [3/3]

template<typename E >
template<typename E2 , typename = typename std::enable_if<std::is_constructible<E,E2>::value>::type>
cpp::bitwizeshift::bad_result_access< E >::bad_result_access ( const std::string &  what_arg,
E2 &&  error 
)

Constructs this exception using the underlying error type for the error and a message.

Parameters
what_argthe message for the failure
errorthe underlying error

Member Function Documentation

◆ error() [1/4]

template<typename E >
auto cpp::bitwizeshift::bad_result_access< E >::error ( ) & -> E &
noexcept

Gets the underlying error.

Returns
the error

◆ error() [2/4]

template<typename E >
auto cpp::bitwizeshift::bad_result_access< E >::error ( ) && -> E &&
noexcept

Gets the underlying error.

Returns
the error

◆ error() [3/4]

template<typename E >
auto cpp::bitwizeshift::bad_result_access< E >::error ( ) const & -> const E &
noexcept

Gets the underlying error.

Returns
the error

◆ error() [4/4]

template<typename E >
auto cpp::bitwizeshift::bad_result_access< E >::error ( ) const && -> const E &&
noexcept

Gets the underlying error.

Returns
the error

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