boost::text::foreach_subrange_if
// In header: <boost/text/algorithm.hpp> template<typename FwdIter, typename Sentinel, typename Pred, typename Func> Func foreach_subrange_if(FwdIter first, Sentinel last, Pred p, Func f);
Calls f(sub) for each subrange sub in [first, last). A subrange is a contiguous subsequence of elements ei for which p(ei) is true. Subranges passed to f are non-overlapping.
f(sub)
sub
[first, last)
ei
p(ei)
f