Result protocol for signaling error via error code or full completion.
More...
#include <error_protocol.hpp>
template<typename Ty, typename ValTy>
typename Ty::template return_type<ValTy>;
{
errp.template with_error<ValTy>(std::declval<std::error_code>())
} -> std::same_as<typename Ty::template return_type<ValTy>>;
{
errp.template with_success<ValTy>(std::declval<ValTy>())
} -> std::same_as<typename Ty::template return_type<ValTy>>;
}
Result protocol for signaling error via error code or full completion.
Definition error_protocol.hpp:39
Result protocol for signaling error via error code or full completion.
- Template Parameters
-
| Ty | type of an error protocol |
| ValTy | type of result value |
Uniform protocol that allows the compile-time selection of an error protocol for a wrapper function when a partial result is disallowed.
- Guarantees
- Error protocol is expected to be transient and be move constructible and assignable. Its destructor is expected to not invoke any meaningful logic.
with_success signals complete success and returns a successful result value. with_error signals error and returns an erronous result value.