Types module

provides the continuable and promise facility for type erasure.

Contents

Typedefs

template<typename... Args>
using continuation_capacity = detail::erasure::continuation_capacity<Args...>
Deduces to the preferred continuation capacity for a possible small functor optimization. The given capacity size is always enough to to avoid any allocation when storing a ready continuable_base.
template<typename... Args>
using continuable = continuable_base<detail::erasure::continuation<Args...>, signature_arg_t<Args...>>
Defines a non-copyable continuation type which uses the function2 backend for type erasure.
template<typename... Args>
using promise = promise_base<detail::erasure::callback<Args...>, signature_arg_t<Args...>>
Defines a non-copyable promise type which is using the function2 backend for type erasure.
using work = promise_base<detail::erasure::work, signature_arg_t<>>
Defines a non-copyable type erasure which is capable of carrying callable objects passed to executors.

Typedef documentation

template<typename... Args>
using continuation_capacity = detail::erasure::continuation_capacity<Args...>

Deduces to the preferred continuation capacity for a possible small functor optimization. The given capacity size is always enough to to avoid any allocation when storing a ready continuable_base.

template<typename... Args>
using continuable = continuable_base<detail::erasure::continuation<Args...>, signature_arg_t<Args...>>

Defines a non-copyable continuation type which uses the function2 backend for type erasure.

Usable like: continuable<int, float>

template<typename... Args>
using promise = promise_base<detail::erasure::callback<Args...>, signature_arg_t<Args...>>

Defines a non-copyable promise type which is using the function2 backend for type erasure.

Usable like: promise<int, float>

using work = promise_base<detail::erasure::work, signature_arg_t<>>

Defines a non-copyable type erasure which is capable of carrying callable objects passed to executors.

The work behaves like a promise<> but the work type erasure uses extra stack space for small object optimization. Additionally the outstanding work can be resolved through an exception.