14#ifndef ZYPPNG_MONADIC_REDO_H_INCLUDED
15#define ZYPPNG_MONADIC_REDO_H_INCLUDED
17#include <zypp-core/ng/meta/FunctionTraits>
18#include <zypp-core/ng/meta/TypeTraits>
19#include <zypp-core/ng/meta/Functional>
20#include <zypp-core/ng/pipelines/operators.h>
26 template<
typename Task,
typename Pred,
typename Arg,
typename =
void >
29 template <
typename T = Arg>
30 static auto execute( Task task, Pred pred, T &&arg ) {
31 Arg store = std::forward<T>(arg);
33 auto res = task ( Arg(store) );
35 return std::move(res);
40 template<
typename Task,
typename Pred >
43 template <
typename T,
typename P>
48 template <
typename Arg>
53 template <
typename T,
typename P>
54 static auto create ( T &&t, P &&p ) {
55 return RedoWhileImpl( std::forward<T>(t), std::forward<P>(p));
64 template <
typename Task,
typename Pred>
71#ifdef ZYPP_ENABLE_ASYNC
72#include <zypp-core/ng/async/pipelines/redo.hpp>
auto redo_while(Task &&todo, Pred &&until)
auto operator()(Arg &&arg)
RedoWhileHelper(T &&t, P &&p)
static auto create(T &&t, P &&p)
static auto execute(Task task, Pred pred, T &&arg)