Wayverb
util::mapping_iterator_adapter< It, Mapper > Class Template Referencefinal

#include <mapping_iterator_adapter.h>

Public Types

using iterator_category = typename std::iterator_traits< It >::iterator_category
 
using value_type = decltype(std::declval< Mapper >()(*std::declval< It >()))
 
using difference_type = typename std::iterator_traits< It >::difference_type
 
using reference = std::add_lvalue_reference_t< value_type >
 
using pointer = std::add_pointer_t< reference >
 

Public Member Functions

constexpr mapping_iterator_adapter (It it)
 
constexpr mapping_iterator_adapter (It it, Mapper mapper)
 
template<class U , class V >
constexpr mapping_iterator_adapter (const mapping_iterator_adapter< U, V > &other)
 
template<class U , class V >
void swap (mapping_iterator_adapter< U, V > &other) noexcept
 
template<class U , class V >
constexpr mapping_iterator_adapteroperator= (mapping_iterator_adapter< U, V > other)
 
constexpr mapping_iterator_adapter (const mapping_iterator_adapter &)=default
 
constexpr mapping_iterator_adapter (mapping_iterator_adapter &&) noexcept=default
 
constexpr mapping_iterator_adapteroperator= (const mapping_iterator_adapter &)=default
 
constexpr mapping_iterator_adapteroperator= (mapping_iterator_adapter &&) noexcept=default
 
constexpr It base () const
 
constexpr value_type operator* () const
 
constexpr auto operator-> () const
 
constexpr value_type operator[] (difference_type n) const
 
constexpr mapping_iterator_adapteroperator++ ()
 
constexpr mapping_iterator_adapteroperator-- ()
 
constexpr mapping_iterator_adapter operator++ (int)
 
constexpr mapping_iterator_adapter operator-- (int)
 
constexpr mapping_iterator_adapter operator+ (difference_type n) const
 
constexpr mapping_iterator_adapter operator- (difference_type n) const
 
constexpr mapping_iterator_adapteroperator+= (difference_type n)
 
constexpr mapping_iterator_adapteroperator-= (difference_type n)
 

Friends

template<typename U , typename V >
class mapping_iterator_adapter
 

Detailed Description

template<typename It, typename Mapper>
class util::mapping_iterator_adapter< It, Mapper >

Allows inline transformations on iterators. When the iterator is dereferenced, it is passed through a unary functor of some kind, and the returned value is the output of this functor. Useful for 'pipelining' operations on iterators, or for adapting ranges when passing them to methods in a way that doesn't require a new range to be allocated


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