LLVM  8.0.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::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 "llvm/ADT/iterator.h"

Inheritance diagram for llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >:
Inheritance graph
[legend]
Collaboration diagram for llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >:
Collaboration graph
[legend]

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 llvm::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 ()=default
 
 iterator_adaptor_base (WrappedIteratorT u)
 
const WrappedIteratorT & wrapped () const
 

Protected Attributes

WrappedIteratorT I
 

Additional Inherited Members

- Protected Types inherited from llvm::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>
class llvm::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.

Definition at line 206 of file iterator.h.

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 = 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>
using llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::difference_type = DifferenceTypeT

Definition at line 224 of file iterator.h.

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 = 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>
llvm::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 = 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>
llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::iterator_adaptor_base ( WrappedIteratorT  u)
inlineexplicitprotected

Definition at line 216 of file iterator.h.

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 = 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>
ReferenceT llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator* ( ) const
inline

Definition at line 272 of file iterator.h.

◆ 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 = 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>
DerivedT& llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator++ ( )
inline

Definition at line 251 of file iterator.h.

◆ 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 = 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>
DerivedT& llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator+= ( difference_type  n)
inline

Definition at line 226 of file iterator.h.

◆ 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 = 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>
difference_type llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator- ( const DerivedT &  RHS) const
inline

Definition at line 241 of file iterator.h.

◆ 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 = 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>
DerivedT& llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-- ( )
inline

Definition at line 256 of file iterator.h.

◆ 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 = 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>
DerivedT& llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-= ( difference_type  n)
inline

Definition at line 233 of file iterator.h.

◆ 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 = 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>
bool llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator< ( const DerivedT &  RHS) const
inline

Definition at line 265 of file iterator.h.

◆ 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 = 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>
bool llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator== ( const DerivedT &  RHS) const
inline

Definition at line 264 of file iterator.h.

◆ 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 = 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>
const WrappedIteratorT& llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::wrapped ( ) const
inlineprotected

Definition at line 221 of file iterator.h.

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 = 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>
WrappedIteratorT llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::I
protected

Definition at line 212 of file iterator.h.


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