A Future that runs a coroutine and handles allocation failure gracefully.
Created by calling coro.MakeFallible(...).
Public Types | |
| using | value_type = typename internal::AllocFailureFutureValueType< T, Handler >::type |
Public Member Functions | |
| template<typename H = Handler> requires (!internal::IsFallibleCoro<std::remove_cvref_t<H>> && !internal::IsCoro<std::remove_cvref_t<H>> && internal::AllocFailureHandler<Handler, T> && std::constructible_from<Handler, H>) | |
| constexpr | FallibleCoro (H &&handler) |
|
template<typename H = Handler> requires internal::AllocFailureHandler<Handler, T> && std::constructible_from<Handler, H> | |
| constexpr | FallibleCoro (Coro< T > &&coro, H &&handler={}) |
| FallibleCoro (const FallibleCoro &)=delete | |
| FallibleCoro & | operator= (const FallibleCoro &)=delete |
| constexpr | FallibleCoro (FallibleCoro &&other) noexcept |
|
template<typename OtherHandler > requires (!std::is_same_v<Handler, OtherHandler> && internal::AllocFailureHandler<Handler, T> && std::constructible_from<Handler, OtherHandler>) | |
| constexpr | FallibleCoro (FallibleCoro< T, OtherHandler > &&other) noexcept |
| constexpr FallibleCoro & | operator= (FallibleCoro &&other) noexcept |
|
template<typename OtherHandler > requires (!std::is_same_v<Handler, OtherHandler> && !std::is_reference_v<Handler> && internal::AllocFailureHandler<Handler, T> && std::assignable_from<Handler&, OtherHandler>) | |
| constexpr FallibleCoro & | operator= (FallibleCoro< T, OtherHandler > &&other) noexcept |
| constexpr FallibleCoro & | operator= (Coro< T > &&coro) noexcept |
| bool | is_pendable () const |
| bool | is_complete () const |
| Poll< value_type > | Pend (Context &cx) |
|
inlineexplicitconstexpr |
Creates an empty FallibleCoro (is_pendable() is false) configured with an allocation failure handler.
A Coro<T> must be assigned before Pend() is called, or Pend() will crash.
|
inlineconstexprnoexcept |
Replaces the inner coroutine while preserving the configured allocation failure handler.