Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This version of Boost is under active development. You are currently in the develop branch. The current version is 1.91.0.
boost::container::for_each_while
// In header: <boost/container/hub.hpp> template<typename T, typename Allocator, typename F> std::pair< typename hub< T, Allocator >::const_iterator, F > for_each_while(const hub< T, Allocator > & x, F f);
Effects: Applies f to the elements of x while f returns true. Equivalent to for_each_while(x.cbegin(), x.cend(), std::ref(f)) with f moved into the returned pair.
Returns: A pair with the iterator past the last visited element and std::move(f).
Note: Potentially faster than range iteration thanks to internal unrolling and prefetching.