37 struct interleave_rf_gen
39 template <
typename ReducingFnT>
44 template <
typename StateT>
45 auto impl(StateT&& s) -> StateT&&
47 return std::forward<StateT>(s);
50 template <
typename StateT,
typename InputT,
typename ...InputTs>
51 auto impl(StateT&& s, InputT&& i, InputTs&& ...is)
52 -> decltype(step(std::forward<StateT>(s), std::forward<InputT>(i)))
55 ? impl(step(std::forward<StateT>(s), std::forward<InputT>(i)),
56 std::forward<InputTs>(is)...)
57 :
std::forward<StateT>(s);
60 template <
typename StateT,
typename InputT,
typename ...InputTs>
61 auto operator() (StateT&& s, InputT&& i, InputTs&& ...is)
62 -> decltype(step(std::forward<StateT>(s), std::forward<InputT>(i)))
64 return impl(step(std::forward<StateT>(s), std::forward<InputT>(i)),
65 std::forward<InputTs>(is)...);
72 using interleave_t = transducer_impl<detail::interleave_rf_gen>;
C++ amazing templates and reusable implementations awesomeness.