WPILibC++ 2023.4.3-108-ge5452e3
wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > Class Template Reference

CRTP base class for adapting an iterator to a different type. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/iterator.h>

Inheritance diagram for wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >:
wpi::iterator_facade_base< DerivedT, typename std::iterator_traits< WrappedIteratorT >::iterator_category, typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::difference_type, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::pointer, typename std::iterator_traits< WrappedIteratorT >::value_type * >, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::reference, typename std::iterator_traits< WrappedIteratorT >::value_type & > > wpi::pointee_iterator< WrappedIteratorT, T >

Public Types

using difference_type = DifferenceTypeT
 
- Public Types inherited from wpi::iterator_facade_base< DerivedT, typename std::iterator_traits< WrappedIteratorT >::iterator_category, typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::difference_type, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::pointer, typename std::iterator_traits< WrappedIteratorT >::value_type * >, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::reference, typename std::iterator_traits< WrappedIteratorT >::value_type & > >
using iterator_category = typename std::iterator_traits< WrappedIteratorT >::iterator_category
 
using value_type = typename std::iterator_traits< WrappedIteratorT >::value_type
 
using difference_type = typename std::iterator_traits< WrappedIteratorT >::difference_type
 
using pointer = std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::pointer, typename std::iterator_traits< WrappedIteratorT >::value_type * >
 
using reference = std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::reference, typename std::iterator_traits< WrappedIteratorT >::value_type & >
 

Public Member Functions

DerivedT & operator+= (difference_type n)
 
DerivedT & operator-= (difference_type n)
 
difference_type operator- (const DerivedT &RHS) const
 
DerivedT & operator++ ()
 
DerivedT & operator-- ()
 
ReferenceT operator* () const
 
- Public Member Functions inherited from wpi::iterator_facade_base< DerivedT, typename std::iterator_traits< WrappedIteratorT >::iterator_category, typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::difference_type, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::pointer, typename std::iterator_traits< WrappedIteratorT >::value_type * >, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::reference, typename std::iterator_traits< WrappedIteratorT >::value_type & > >
DerivedT operator+ (typename std::iterator_traits< WrappedIteratorT >::difference_type n) const
 
DerivedT operator- (typename std::iterator_traits< WrappedIteratorT >::difference_type n) const
 
DerivedT & operator++ ()
 
DerivedT operator++ (int)
 
DerivedT & operator-- ()
 
DerivedT operator-- (int)
 
bool operator!= (const DerivedT &RHS) const
 
bool operator> (const DerivedT &RHS) const
 
bool operator<= (const DerivedT &RHS) const
 
bool operator>= (const DerivedT &RHS) const
 
PointerProxy operator-> () const
 
ReferenceProxy operator[] (typename std::iterator_traits< WrappedIteratorT >::difference_type n) const
 

Protected Member Functions

 iterator_adaptor_base ()=default
 
 iterator_adaptor_base (WrappedIteratorT u)
 
const WrappedIteratorT & wrapped () const
 

Protected Attributes

WrappedIteratorT I
 

Friends

bool operator== (const iterator_adaptor_base &LHS, const iterator_adaptor_base &RHS)
 
bool operator< (const iterator_adaptor_base &LHS, const iterator_adaptor_base &RHS)
 

Additional Inherited Members

- Protected Types inherited from wpi::iterator_facade_base< DerivedT, typename std::iterator_traits< WrappedIteratorT >::iterator_category, typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::difference_type, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::pointer, typename std::iterator_traits< WrappedIteratorT >::value_type * >, std::conditional_t< std::is_same< typename std::iterator_traits< WrappedIteratorT >::value_type, typename std::iterator_traits< WrappedIteratorT >::value_type >::value, typename std::iterator_traits< WrappedIteratorT >::reference, typename std::iterator_traits< WrappedIteratorT >::value_type & > >
enum  
 

Detailed Description

template<typename DerivedT, typename WrappedIteratorT, typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
class wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >

CRTP base class for adapting an iterator to a different type.

This class can be used through CRTP to adapt one iterator into another. Typically this is done through providing in the derived class a custom operator* implementation. Other methods can be overridden as well.

Member Typedef Documentation

◆ difference_type

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
using wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::difference_type = DifferenceTypeT

Constructor & Destructor Documentation

◆ iterator_adaptor_base() [1/2]

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::iterator_adaptor_base ( )
protecteddefault

◆ iterator_adaptor_base() [2/2]

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::iterator_adaptor_base ( WrappedIteratorT  u)
inlineexplicitprotected

Member Function Documentation

◆ operator*()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
ReferenceT wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator* ( ) const
inline

◆ operator++()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator++ ( )
inline

◆ operator+=()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator+= ( difference_type  n)
inline

◆ operator-()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
difference_type wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator- ( const DerivedT &  RHS) const
inline

◆ operator--()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-- ( )
inline

◆ operator-=()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
DerivedT & wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-= ( difference_type  n)
inline

◆ wrapped()

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
const WrappedIteratorT & wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::wrapped ( ) const
inlineprotected

Friends And Related Function Documentation

◆ operator<

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
bool operator< ( const iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  LHS,
const iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  RHS 
)
friend

◆ operator==

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
bool operator== ( const iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  LHS,
const iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT > &  RHS 
)
friend

Member Data Documentation

◆ I

template<typename DerivedT , typename WrappedIteratorT , typename IteratorCategoryT = typename std::iterator_traits<WrappedIteratorT>::iterator_category, typename T = typename std::iterator_traits<WrappedIteratorT>::value_type, typename DifferenceTypeT = typename std::iterator_traits<WrappedIteratorT>::difference_type, typename PointerT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>, typename ReferenceT = std::conditional_t< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
WrappedIteratorT wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::I
protected

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