WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT, WrappedTraitsT > Class Template Reference

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

#include <iterator.h>

Inheritance diagram for wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT, WrappedTraitsT >:
wpi::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >

Public Types

using difference_type = DifferenceTypeT
 

Public Member Functions

DerivedT & operator+= (difference_type n)
 
DerivedT & operator-= (difference_type n)
 
difference_type operator- (const DerivedT &RHS) const
 
DerivedT & operator++ ()
 
DerivedT & operator-- ()
 
bool operator== (const DerivedT &RHS) const
 
bool operator< (const DerivedT &RHS) const
 
ReferenceT operator* () const
 
- Public Member Functions inherited from wpi::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >
DerivedT operator+ (DifferenceTypeT n) const
 
DerivedT operator- (DifferenceTypeT 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
 
PointerT operator-> ()
 
PointerT operator-> () const
 
ReferenceProxy operator[] (DifferenceTypeT n)
 
ReferenceProxy operator[] (DifferenceTypeT n) const
 

Protected Member Functions

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

Protected Attributes

WrappedIteratorT I
 

Additional Inherited Members

- Protected Types inherited from wpi::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >
enum  { IsRandomAccess, IsBidirectional }
 

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 = typename std::conditional< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::pointer, T *>::type, typename ReferenceT = typename std::conditional< std::is_same<T, typename std::iterator_traits< WrappedIteratorT>::value_type>::value, typename std::iterator_traits<WrappedIteratorT>::reference, T &>::type, typename WrappedTraitsT = std::iterator_traits<WrappedIteratorT>>
class wpi::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT, WrappedTraitsT >

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.


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