10 #ifndef LARDATA_UTILITIES_FILTERRANGEFOR_H 11 #define LARDATA_UTILITIES_FILTERRANGEFOR_H 14 #include <boost/iterator/filter_iterator.hpp> 57 template <
typename Range,
typename Pred>
70 template <
typename Range,
typename Pred>
91 auto end =
getEnd(std::forward<Range>(range));
92 return boost::make_filter_iterator(std::forward<Pred>(pred),
begin,
end);
98 auto end =
getEnd(std::forward<Range>(range));
99 return boost::make_filter_iterator(std::forward<Pred>(pred),
end,
end);
127 template <
typename Range,
typename Pred>
131 std::forward<Pred>(pred));
140 #endif // LARDATA_UTILITIES_FILTERRANGEFOR_H Namespace for general, non-LArSoft-specific utilities.
static auto makeEndIterator(Range &&range, Pred &&pred)
Create a Boost filter iterator pointing to the end of data.
decltype(makeBeginIterator(std::declval< Range && >(), std::declval< Pred && >())) begin_iterator_t
auto filterRangeFor(Range &&range, Pred &&pred) -> decltype(auto)
Provides iteration only through elements passing a condition.
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
static auto makeBeginIterator(Range &&range, Pred &&pred)
Create a Boost filter iterator pointing to the beginning of data.
static auto getEnd(Range &&range) -> decltype(auto)
Extract the end iterator from a range.
FilterRangeForStruct(Range &&range, Pred &&pred)
Extracts the iterators from the specified range.
decltype(makeEndIterator(std::declval< Range && >(), std::declval< Pred && >())) end_iterator_t
represents a "Range" w/ notion of ordering. A range is defined by a pair of "start" and "end" values...
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
static auto getBegin(Range &&range) -> decltype(auto)
Extract the begin iterator from a range.