12 #include <hipipe/core/stream/stream_t.hpp>
14 #include <range/v3/view/transform.hpp>
17 namespace hipipe::stream {
19 namespace rgv = ranges::views;
23 template<
typename... Columns>
26 friend rgv::view_access;
28 static auto bind(keep_fn<Columns...> fun)
30 return ranges::make_pipeable(std::bind(fun, std::placeholders::_1));
34 CPP_template(
typename Rng)(requires ranges::input_range<Rng>)
38 [](batch_t batch) -> batch_t {
40 (result.raw_insert_or_assign<Columns>(std::move(batch.at<Columns>())), ...);
46 CPP_template(
typename Rng)(requires !ranges::input_range<Rng>)
47 void operator()(Rng&&)
const
49 CONCEPT_ASSERT_MSG(ranges::input_range<Rng>(),
50 "stream::keep only works on ranges satisfying the input_range concept.");
68 template <
typename... Columns>
69 rgv::view<detail::keep_fn<Columns...>>
keep{};