15 #ifndef ZYPP_ZYPPNG_MONADIC_TRANSFORM_H 16 #define ZYPP_ZYPPNG_MONADIC_TRANSFORM_H 18 #include <zypp-core/zyppng/meta/TypeTraits> 19 #include <zypp-core/zyppng/meta/Functional> 20 #include <zypp-core/zyppng/pipelines/AsyncResult> 26 template <
template<
class,
class... >
class Container,
28 typename Transformation,
31 Container<Ret>
transform( Container<Msg, CArgs...>&& val, Transformation &&transformation )
34 std::transform( std::make_move_iterator(val.begin()), std::make_move_iterator(val.end()), std::back_inserter(res), std::forward<Transformation>(transformation) );
38 template <
template<
class,
class... >
class Container,
40 typename Transformation,
43 Container<Ret>
transform(
const Container<Msg, CArgs...>& val, Transformation &&transformation )
46 std::transform( val.begin(), val.end(), std::back_inserter(res), std::forward<Transformation>(transformation) );
51 template <
typename Transformation >
53 Transformation
function;
55 template<
class Container >
57 if constexpr ( detail::is_sync_monad_cb_with_async_res_v<Transformation, typename Container::value_type> ) {
69 template <
typename Transformation>
73 std::forward<Transformation>(transformation)};
auto transform(Transformation &&transformation)
Container< Ret > transform(Container< Msg, CArgs... > &&val, Transformation &&transformation)
typename result_of< T >::type result_of_t