15 #ifndef LARDATA_UTILITIES_FOR_EACH_ASSOCIATED_GROUP_H 16 #define LARDATA_UTILITIES_FOR_EACH_ASSOCIATED_GROUP_H 25 #include "range/v3/algorithm/for_each.hpp" 26 #include "range/v3/view/group_by.hpp" 27 #include "range/v3/view/transform.hpp" 28 #include "range/v3/view/map.hpp" 29 #include "range/v3/view/all.hpp" 47 template <
class A,
class F>
48 [[deprecated(
"Use art::for_each_group() instead")]]
97 ranges::view::group_by([](
auto a1,
auto a2) {
return a1.first ==
a2.first;}) |
98 ranges::view::transform([] (
auto pairs) {
return pairs | ranges::view::values |
util::range_for;}) |
155 | ranges::view::group_by([](
auto a1,
auto a2) {
return a1.first ==
a2.first;})
156 | ranges::view::transform([] (
auto pairs)
158 return std::make_pair(
179 template <
typename Groups>
180 auto groupByIndex(Groups&& groups, std::size_t index) -> decltype(
auto)
181 {
return *(std::next(groups.begin(), index)); }
185 #endif // LARDATA_UTILITIES_FOR_EACH_ASSOCIATED_GROUP_H auto associated_groups_with_left(A const &assns)
Helper functions to access associations in order, also with key.
Namespace for general, non-LArSoft-specific utilities.
void for_each_associated_group(A const &assns, F &func)
Helper functions to access associations in order.
Utility function to enable range-for on different type iterators.
auto groupByIndex(Groups &&groups, std::size_t index) -> decltype(auto)
Returns the group within groups with the specified index.
auto associated_groups(A const &assns)
Helper functions to access associations in order.
constexpr RangeForWrapperTag range_for
void for_each_group(art::Assns< A, B, D > const &assns, F func)
Helper functions to access associations in order.