arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/utility/result.hpp>
Public Types | |
using | result_type = std::decay_t< ResultType > |
using | exception_type = ExceptionType |
Public Member Functions | |
constexpr | result (result_type value) noexcept |
constexpr | result (ExceptionType ex) noexcept |
constexpr bool | has_result () const noexcept |
constexpr bool | has_error () const noexcept |
constexpr | operator bool () const noexcept |
constexpr bool | operator! () const noexcept |
constexpr bool | operator== (const result &other) const noexcept |
constexpr bool | operator!= (const result &other) const noexcept |
result_type * | get_if () noexcept |
const result_type * | get_if () const noexcept |
result_type | extract () |
auto | get () const -> std::conditional_t<(sizeof(std::size_t) >=sizeof(result_type)) &&std::is_copy_constructible_v< result_type >, result_type, const result_type & > |
void | throw_exception () const |
Friends | |
constexpr friend bool | operator== (const result &lhs, const result_type &rhs) noexcept |
constexpr friend bool | operator!= (const result &lhs, const result_type &rhs) noexcept |
constexpr friend bool | operator== (const result_type &lhs, const result &rhs) noexcept |
constexpr friend bool | operator!= (const result_type &lhs, const result &rhs) noexcept |
Result or exception wrapper.
ValueType | Result type |
ExceptionType | Exception type |
Definition at line 19 of file result.hpp.
using arg_router::utility::result< ResultType, ExceptionType >::exception_type = ExceptionType |
Exception type.
Definition at line 28 of file result.hpp.
using arg_router::utility::result< ResultType, ExceptionType >::result_type = std::decay_t<ResultType> |
Result type.
Definition at line 26 of file result.hpp.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
Move the result of this instance, or throw the exception if one is held.
As this method moves the value or exception out of the instance, it should not be called again unless you know the value or exception is not move-constructible.
ExceptionType | Thrown if the instance holds an exception |
Definition at line 168 of file result.hpp.
|
inline |
Returns the the result of this instance, or throw the exception if one is held.
ExceptionType | Thrown if the instance holds an exception |
Definition at line 182 of file result.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
Returns a pointer to the result, or nullptr if this instance holds an exception.
Definition at line 147 of file result.hpp.
|
inlineconstexprnoexcept |
True if this instance holds an exception.
Definition at line 54 of file result.hpp.
|
inlineconstexprnoexcept |
True if this instance holds a result.
Definition at line 48 of file result.hpp.
|
inlineexplicitconstexprnoexcept |
True if this instance holds a result.
Definition at line 60 of file result.hpp.
|
inlineconstexprnoexcept |
True if this instance holds an exception.
Definition at line 66 of file result.hpp.
|
inlineconstexprnoexcept |
Inequality operator
other | Instance to compare against |
Definition at line 86 of file result.hpp.
|
inlineconstexprnoexcept |
Equality operator
other | Instance to compare against |
Definition at line 73 of file result.hpp.
|
inline |
Throws the exception if present, otherwise does nothing.
ExceptionType | Thrown if the instance holds an exception |
Definition at line 198 of file result.hpp.
|
friend |
Result type inequality operator
lhs | Instance to compare against |
rhs | Value instance to compare against |
Definition at line 112 of file result.hpp.
|
friend |
Result type inequality operator
lhs | Instance to compare against |
rhs | Value instance to compare against |
Definition at line 136 of file result.hpp.
|
friend |
Result type equality operator
lhs | Instance to compare against |
rhs | Value instance to compare against |
Definition at line 97 of file result.hpp.
|
friend |
Result type equality operator
lhs | Value Instance to compare against |
rhs | Instance to compare against |
Definition at line 124 of file result.hpp.