Template Struct FilteredIterator

Struct Documentation

template<typename Parent, typename Iterator, typename Getter, typename Predicate>
struct FilteredIterator

Public Types

using iterator_category = std::bidirectional_iterator_tag
using value_type = std::remove_reference_t<std::invoke_result_t<Getter, Parent, Iterator>>
using difference_type = std::ptrdiff_t
using pointer = value_type*
using reference = value_type&

Public Functions

constexpr FilteredIterator() noexcept = default
constexpr FilteredIterator(const FilteredIterator&) = default
constexpr FilteredIterator &operator=(const FilteredIterator&) = default
constexpr FilteredIterator(FilteredIterator&&) noexcept = default
constexpr FilteredIterator &operator=(FilteredIterator&&) noexcept = default
template<typename OtherParent, typename OtherIterator, typename = std::enable_if_t<std::is_convertible_v<OtherParent, Parent> && std::is_convertible_v<OtherIterator, Iterator>>*>
inline explicit constexpr FilteredIterator(const FilteredIterator<OtherParent, OtherIterator, Getter, Predicate> &other)
inline constexpr FilteredIterator(Parent p, Iterator begin, Iterator end, Iterator curr, Getter getter = {}, Predicate pred = {})
inline constexpr reference operator*() const
inline constexpr pointer operator->() const
inline constexpr FilteredIterator &operator++()
inline constexpr FilteredIterator operator++(int)
inline constexpr FilteredIterator &operator--()
inline constexpr FilteredIterator operator--(int)

Public Members

Parent parent
Iterator first
Iterator last
Iterator current
Getter getter
Predicate predicate

Friends

inline friend constexpr friend bool operator== (const FilteredIterator &lhs, const FilteredIterator &rhs)
inline friend constexpr friend bool operator!= (const FilteredIterator &lhs, const FilteredIterator &rhs)