Interface to represent the result of calling a detected function.
More...
#include <callresult.hpp>
Inherited by resilient::detail::OperationResult< T >.
|
using | ConstRefType = const std::decay_t< T > & |
| Convenience type alias for a const ref to type T.
|
|
|
(Note that these are not member functions.)
|
template<typename Visitor , typename T > |
| decltype (auto) constexpr resilient::visit(Visitor &&visitor, ICallResult< T > &callresult) |
| Visit the ICallResult<T> as if it was a variant. More...
|
|
template<typename T>
class resilient::ICallResult< T >
Interface to represent the result of calling a detected function.
A detected function invokation can result in either:
- returning a result
- throwing an exception
- Template Parameters
-
T | The type returned by the detected function. |
Consume (signal as handled) an exception if the detected threw one.
It's invalid to call this function if isException()
returns false.
Get a pointer of the thrown exception.
It's invalid to call this function is isException()
returns false.
- Returns
- const std::exception_ptr&
Access the result of the detected function.
It's invalid to call this function if isException()
returns true.
- Returns
- ConstRefType The value returned by the detected function.
Whether the detected function invokation threw an exception.
- Returns
- true An exception was thrown.
-
false An result was returned
template<typename Visitor , typename T >
decltype |
( |
Visitor && |
visitor, |
|
|
ICallResult< T > & |
callresult |
|
) |
| |
|
related |
Visit the ICallResult<T>
as if it was a variant.
- Template Parameters
-
Visitor | The type of the object which defines the overloaded operator() to be called. |
T | The type returned by the detected function. |
- Parameters
-
visitor | The object called with either the std::exception_ptr or const T& . |
callresult | The callresult object. |
- Returns
- The type returned by the visitor.
The documentation for this class was generated from the following file:
- include/resilient/detector/callresult.hpp