|
co_usb
|
Error protocol signaling error into a given error code reference and returning an optional. More...
#include <error_protocol.hpp>
Public Types | |
| template<typename ValTy > | |
| using | return_type = std::optional< ValTy > |
Public Member Functions | |
| constexpr | as_optional_t (std::error_code &ec) noexcept |
| template<typename U > | |
| auto | with_error (std::error_code ec) noexcept -> return_type< U > |
| Signals error to stored error code reference. | |
| template<typename U , typename... Args> | |
| auto | with_success (Args &&...args) noexcept(std::is_nothrow_constructible_v< U, Args... >) -> return_type< U > |
| Signals success via returned optional. | |
Error protocol signaling error into a given error code reference and returning an optional.
On error, assigns the given error code to a stored error code reference and returns a nullopt. On success, clears error code by refernce and returns an optional with a success value.
with_error is noexcept. with_success is noexcept if chosen ctor is noexcept. | using co_usb::detail::as_optional_t::return_type = std::optional<ValTy> |
|
inlineexplicitconstexprnoexcept |
|
inlinenoexcept |
Signals error to stored error code reference.
|
inlinenoexcept |
Signals success via returned optional.