halcheck 1.0
Loading...
Searching...
No Matches
halcheck::lib::filter_iterator< I, F > Class Template Reference

An iterator adaptor that skips elements that do not satisfy user-defined predicate. More...

#include <filter.hpp>

Inheritance diagram for halcheck::lib::filter_iterator< I, F >:
halcheck::lib::iterator_interface< filter_iterator< I, F > >

Public Types

using value_type = lib::iter_value_t<I>
 The type of value pointed to by this type of iterator.
 
using reference = lib::iter_reference_t<I>
 The return type of operator*.
 
using pointer = void
 This iterator type does not support operator->.
 
using difference_type = lib::iter_difference_t<I>
 The return type of operator-.
 
using iterator_category
 Indicates the level of supported iterator operations this type provides.
 

Public Member Functions

constexpr filter_iterator ()=default
 Constructs a default filter_iterator.
 
 filter_iterator (I base, I end, F fun)
 Constructs a filter_iterator from a (begin, end] pair of iterators and a predicate.
 
template<typename I2 , typename F2 >
constexpr filter_iterator (filter_iterator< I2, F2 > other)
 Performs a conversion on a filter_iterator with compatible type parameters.
 
template<typename I2 , typename F2 >
constexpr filter_iterator (filter_iterator< I2, F2 > other)
 Performs a conversion on a filter_iterator with compatible type parameters.
 
constexpr const I & base () const &noexcept
 Get a reference to the base iterator of this filter_iterator.
 
base () &&
 Get the base iterator of this filter_iterator.
 
constexpr reference operator* () const noexcept(noexcept(*std::declval< const I & >()))
 Dereferences the base iterator.
 
filter_iteratoroperator++ ()
 Advances the base iterator to the next element that satisfies the predicate.
 
template<bool _ = true>
filter_iteratoroperator-- ()
 Advances the base iterator backwards to the previous element that satisfies the predicate.
 
constexpr lib::iter_reference_t< I > operator[] (lib::iter_difference_t< I > n) const
 Access the element at the specified index.
 
operator++ (int)
 Advances this iterator.
 
operator-- (int)
 Advances this iterator a step backwards.
 
I & operator-= (lib::iter_difference_t< I > n)
 Advances this iterator the specified number of steps backwards.
 

Friends

constexpr bool operator== (const filter_iterator &lhs, const filter_iterator &rhs)
 Compares two filter_iterators for equality.
 

Detailed Description

template<typename I, typename F>
class halcheck::lib::filter_iterator< I, F >

An iterator adaptor that skips elements that do not satisfy user-defined predicate.

Template Parameters
IThe base iterator type.
FThe type of predicate.

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