Transforms module

provides utilities to convert continuable_bases to other types such as (std::future).

Contents

Namespaces

namespace cti::transforms
The namespace transforms declares callable objects that transform any continuable_base to an object or to a continuable_base itself.

Typedefs

template<typename T>
using transform = detail::types::transform<T>
A callable tag object which marks a wrapped callable object as continuable transformation which enables some useful overloads.

Functions

template<typename T>
auto make_transform(T&& callable) -> auto
Wraps the given callable object into a transform class.
auto futurize() -> auto
Returns a transform that if applied to a continuable, it will start the continuation chain and returns the asynchronous result as std::future<...>.
auto flatten() -> auto
Returns a transform that if applied to a continuable, it will ignores all error which ocured until the point the transform was applied.

Typedef documentation

template<typename T>
using transform = detail::types::transform<T>

A callable tag object which marks a wrapped callable object as continuable transformation which enables some useful overloads.

Function documentation

template<typename T>
auto make_transform(T&& callable)

Wraps the given callable object into a transform class.

auto futurize()

Returns a transform that if applied to a continuable, it will start the continuation chain and returns the asynchronous result as std::future<...>.

Returns

Returns a std::future<...> which becomes ready as soon as the the continuation chain has finished. The signature of the future depends on the result type:

Continuation typeReturn type
continuable_base with <>std::future<void>
continuable_base with <Arg>std::future<Arg>
continuable_base with <Args...>std::future<std::tuple<Args...>>

auto flatten()

Returns a transform that if applied to a continuable, it will ignores all error which ocured until the point the transform was applied.

Returns Returns a continuable with the same signature as applied to.