herald
2.0.0
|
#include <ranges.h>
Public Member Functions | |
filtered_iterator_proxy (Coll &coll, Pred pred) | |
filtered_iterator_proxy (filtered_iterator_proxy &&other) | |
filtered_iterator_proxy (const filtered_iterator_proxy &other) | |
auto | operator* () -> const ValT & |
filtered_iterator_proxy< Coll, Pred > & | operator++ () |
prefix operator | |
filtered_iterator_proxy< Coll, Pred > | operator++ (int) |
filtered_iterator_proxy< Coll, Pred > | operator+ (int by) |
bool | operator== (IterT otherIter) const |
bool | operator!= (IterT otherIter) const |
IterT & | wrapped () |
IterT & | end () |
bool | ended () |
Coll & | collection () const |
Pred | predicate () const |
Friends | |
bool | operator!= (IterT otherIter, filtered_iterator_proxy< Coll, Pred > thisIter) |
bool | operator== (IterT otherIter, filtered_iterator_proxy< Coll, Pred > thisIter) |
Now we create a version that selectively returns the underlying iterator's elements using filter_fn Use like:- myCollection is a collection with 14,16,19,45,66 in it (ints) filtered_iterator_proxy<> proxy(myCollection, in_range<int>(18,65)); while (proxy != std::end(myCollection)) { // Could also use !proxy.ended() std::cout << *proxy << std::endl; // prints ONLY 19 and 45 ++proxy; }