OpenABF 2.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
OpenABF::detail::FilteringIterator< Iter, Pred > Class Template Reference

Input iterator that skips elements not matching a predicate. More...

#include <OpenABF/OpenABF.hpp>

Public Types

using difference_type = std::ptrdiff_t
 
using value_type = typename std::iterator_traits< Iter >::value_type
 
using pointer = typename std::iterator_traits< Iter >::pointer
 
using reference = typename std::iterator_traits< Iter >::reference
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

 FilteringIterator (Iter current, Iter end, Pred pred)
 
auto operator* () const -> reference
 
auto operator-> () const -> pointer
 
auto operator++ () -> FilteringIterator &
 
auto operator== (const FilteringIterator &other) const -> bool
 
auto operator!= (const FilteringIterator &other) const -> bool
 

Private Member Functions

void advance_to_next ()
 

Private Attributes

Iter current_ {}
 
Iter end_ {}
 
Pred pred_ {}
 

Detailed Description

template<typename Iter, typename Pred>
class OpenABF::detail::FilteringIterator< Iter, Pred >

Input iterator that skips elements not matching a predicate.

Wraps a base iterator and advances automatically past elements for which pred(*it) is false.