5 #ifndef DOXYGEN_SKIP_PROPERTY
11 task_base_t() =
default;
12 virtual ~task_base_t();
16 counted_ptr<state_base_t> _state;
33 template<
class _Ty,
class = std::
void_t<>>
36 #ifndef DOXYGEN_SKIP_PROPERTY
38 struct task_t<_Ty, std::void_t<traits::is_future<std::remove_reference_t<_Ty>>>> :
public task_base_t
40 using future_type = std::remove_reference_t<_Ty>;
41 using value_type =
typename future_type::value_type;
50 void initialize(future_type& f)
52 _state = f._state.get();
57 struct task_t<generator_t<_Ty>> :
public task_base_t
59 using value_type = _Ty;
60 using future_type = generator_t<value_type>;
61 using state_type = state_generator_t;
64 task_t(future_type& f)
69 void initialize(future_type& f)
71 _state = f.detach_state();
81 struct ctx_task_t :
public task_t<remove_cvref_t<decltype(std::declval<_Ctx>()())>>
83 using context_type = _Ctx;
85 context_type _context;
87 ctx_task_t(context_type ctx)
88 : _context(std::move(ctx))
90 decltype(
auto) f = _context();
94 #endif //DOXYGEN_SKIP_PROPERTY