TermOx
Public Types | Public Member Functions | Friends | List of all members
ox::Transform_iterator< Iter, Map_fn > Class Template Reference

operator*() will apply map to the result of the underlying deref result. More...

#include <transform_iterator.hpp>

Public Types

using iterator_category = typename Iter::iterator_category
 
using difference_type = typename Iter::difference_type
 
using reference = std::invoke_result_t< Map_fn, typename Iter::reference >
 
using value_type = std::remove_reference_t< reference >
 
using pointer = value_type *
 

Public Member Functions

 Transform_iterator (Iter it, Map_fn map_fn)
 
 Transform_iterator (Transform_iterator const &)=default
 
 Transform_iterator (Transform_iterator &&)=default
 
Transform_iteratoroperator= (Transform_iterator const &other)
 
Transform_iteratoroperator= (Transform_iterator &&)=default
 
auto operator++ () -> Transform_iterator &
 
auto operator++ (int) -> Transform_iterator
 
auto operator+= (difference_type n) -> Transform_iterator &
 
auto operator+ (difference_type n) -> Transform_iterator
 
auto operator-- () -> Transform_iterator &
 
auto operator-- (int) -> Transform_iterator
 
auto operator-= (difference_type n) -> Transform_iterator &
 
auto operator- (Transform_iterator const &other) -> difference_type
 
auto operator- (difference_type n) -> Transform_iterator
 
auto operator* () const -> reference
 
auto operator== (Transform_iterator const &other) const -> bool
 
auto operator!= (Transform_iterator const &other) const -> bool
 
template<typename T >
auto operator== (T const &other) const -> bool
 
template<typename T >
auto operator!= (T const &other) const -> bool
 
auto underlying () const -> Iter
 

Friends

auto operator+ (difference_type n, Transform_iterator const &it) -> Transform_iterator
 

Detailed Description

template<typename Iter, typename Map_fn>
class ox::Transform_iterator< Iter, Map_fn >

operator*() will apply map to the result of the underlying deref result.

Should work both as a const_iterator and non-const iterator, depending on the type of iterator given at construction, and if the map_fn works in both const and non-const conditions.


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