herald  2.0.0
Public Types | Public Member Functions | Friends | List of all members
herald::analysis::views::filtered_iterator_proxy< Coll, Pred, ValT, IterT, SizeT > Struct Template Reference

#include <ranges.h>

Public Types

using base_iterator = IterT
 
using base_coll_type = Coll
 
using base_pred_type = Pred
 
using base_value_type = ValT
 
using base_size_type = SizeT
 
using value_type = ValT
 
using iterator = IterT
 
using size_type = SizeT
 
using is_proxy = std::true_type
 

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)
 

Detailed Description

template<typename Coll, typename Pred, typename ValT = typename std::remove_cv<typename Coll::value_type>::type, typename IterT = typename Coll::iterator, typename SizeT = typename Coll::size_type>
struct herald::analysis::views::filtered_iterator_proxy< Coll, Pred, ValT, IterT, SizeT >

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; }


The documentation for this struct was generated from the following file: