this behavior mirrors seasetar::futurize::apply(), where non-future and
non-void return values are converted to future<>, and returned instead.
this change could simplify some use cases where we always return an
immediately available future.
Signed-off-by: Kefu Chai <kchai@redhat.com>
std::invoke(std::forward<ErrorVisitorT>(errfunc),
ErrorT::error_t::from_exception_ptr(std::move(ep)));
} else {
- static_assert(_impl::always_false<return_t>::value,
- "return of Error Visitor is not assignable to future");
- // do nothing with `ep`.
+ result = FuturatorT::type::errorator_type::template make_ready_future<return_t>(
+ std::invoke(std::forward<ErrorVisitorT>(errfunc),
+ ErrorT::error_t::from_exception_ptr(std::move(ep))));
}
}
}