15 #ifndef LARDATA_UTILITIES_FOR_EACH_ASSOCIATED_GROUP_H
16 #define LARDATA_UTILITIES_FOR_EACH_ASSOCIATED_GROUP_H
22 #include "canvas/Persistency/Common/AssnsAlgorithms.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")]]
50 { art::for_each_group(assns, func); }
97 ranges::views::group_by([](
auto a1,
auto a2) {
return a1.first ==
a2.first;}) |
155 | ranges::views::group_by([](
auto a1,
auto a2) {
return a1.first ==
a2.first;})
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.
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 associated_groups(A const &assns)
Helper functions to access associations in order.
constexpr RangeForWrapperTag range_for
auto groupByIndex(Groups &&groups, std::size_t index) -> decltype(auto)
Returns the group within groups with the specified index.