41 template <
typename ReducingFnT,
43 std::size_t ...Indices,
45 typename ...InputRangeTs>
46 auto reduce_nested_non_empty_variadic_impl(estd::index_sequence<Indices...>,
47 meta::pack<InputTs...>,
50 InputRangeTs&& ...ranges)
51 ->
estd::decay_t<decltype(step(initial, *std::begin(ranges)...))>
53 auto firsts = std::make_tuple(std::begin(ranges)...);
54 auto lasts = std::make_tuple(std::end(ranges)...);
55 auto state = step(std::forward<StateT>(initial),
56 std::forward<InputTs>(*std::get<Indices>(firsts))...);
58 meta::noop(++std::get<Indices>(firsts)...);
60 auto new_state = step(std::move(state),
61 std::forward<InputTs>(*std::get<Indices>(firsts))...);
62 state = std::move(new_state);
63 meta::noop(++std::get<Indices>(firsts)...);
69 template <
typename ReducingFnT,
71 typename ...InputRangeTs>
72 auto reduce_nested_non_empty_variadic(ReducingFnT&& step, StateT&& state, InputRangeTs&& ...ranges)
74 reduce_nested_non_empty_variadic_impl(
75 estd::make_index_sequence<
sizeof...(InputRangeTs)> {},
76 meta::pack<meta::copy_decay_t<
78 estd::remove_reference_t<decltype(*std::begin(ranges))> >...>{},
79 std::forward<ReducingFnT>(step),
80 std::forward<StateT>(state),
81 std::forward<InputRangeTs>(ranges)...))
#define ABL_DECLTYPE_RETURN(body_expr)
Utility for defining generic functions with a deduced return type, that are composed of a single expr...
typename std::decay< T >::type decay_t
Similar to C++14 std::decay_t.
C++ amazing templates and reusable implementations awesomeness.