template<typename Iterator, typename Predicate>
struct CGAL::Filter_iterator< Iterator, Predicate >
The iterator adaptor Filter_iterator
acts as a filter on a given range. Whenever the iterator is in- or decremented, it ignores all iterators for which the given Predicate
is true. The iterator category is the same as for Iterator
.
- Attention
- Boost also provides the same functionality via the
boost::filter_iterator
class. Unfortunately, the semantics chosen for accepting or rejecting elements based on the predicate's result are opposite as the semantic chosen here. What is more, the argument of the predicate is different: the predicate used with boost::filter_iterator
must take the value type of the iterator, as argument, and not the iterator itself.
- Template Parameters
-
Iterator | must be a model of ForwardIterator |
Predicate | must be a functor Iterator \( \rightarrow\) bool |