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

A transforming iterator adaptor. More...

#include <transform.hpp>

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

Public Types

using reference = lib::invoke_result_t<const F &, lib::iter_reference_t<I>>
 The type returned by operator*.
 
using iterator_category
 Indicates the level of supported iterator operations this type provides.
 
using value_type = lib::remove_cvref_t<lib::invoke_result_t<const F &, lib::iter_reference_t<I>>>
 The type of value pointed to by this iterator.
 
using difference_type = lib::iter_difference_t<I>
 The type returned by operator- when given two transform_iterators.
 
using pointer = void
 This type does not support operator->.
 

Public Member Functions

constexpr transform_iterator ()=default
 Constructs a default transform_iterator.
 
constexpr transform_iterator (I current, F fun)
 Constructs a transform_iterator with the given base iterator and function.
 
template<typename J , typename G >
constexpr transform_iterator (transform_iterator< J, G > other)
 Performs a conversion on a transform_iterator with compatible type parameters.
 
template<typename J , typename G >
constexpr transform_iterator (transform_iterator< J, G > other)
 Performs a conversion on a transform_iterator with compatible type parameters.
 
constexpr const I & base () const &noexcept
 Get a reference to the base iterator of this transform_iterator.
 
base () &&
 Get the base iterator of this transform_iterator.
 
constexpr lib::invoke_result_t< const F &, lib::iter_reference_t< I > > operator* () const noexcept(lib::is_nothrow_invocable< const F &, lib::iter_reference_t< I > >())
 Dereferences the base iterator an applies the function.
 
transform_iteratoroperator++ ()
 Advances the base iterator.
 
template<bool _ = true>
transform_iteratoroperator-- ()
 Advances the base iterator one step backwards.
 
template<bool _ = true>
transform_iteratoroperator+= (difference_type n)
 Advances the base iterator the specified amount.
 
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 transform_iterator &lhs, const transform_iterator &rhs)
 Compares two transform_iterators for equality.
 
template<bool _ = true>
difference_type operator- (const transform_iterator &lhs, const transform_iterator &rhs)
 Computes the difference between two iterators.
 

Detailed Description

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

A transforming iterator adaptor.

Template Parameters
IThe base iterator type.
FThe type of function to apply to each enumerated value of I.

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