LLVM API Documentation
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of the interface. More...
#include <iterator.h>
Public Member Functions | |
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-> () const |
ReferenceT | operator[] (DifferenceTypeT n) const |
Protected Types | |
enum | { IsRandomAccess, IsBidirectional } |
Friends | |
DerivedT | operator+ (DifferenceTypeT n, const DerivedT &i) |
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of the interface.
Use this when it is reasonable to implement most of the iterator functionality in terms of a core subset. If you need special behavior or there are performance implications for this, you may want to override the relevant members instead.
Note, one abstraction that this does *not* provide is implementing subtraction in terms of addition by negating the difference. Negation isn't always information preserving, and I can see very reasonable iterator designs where this doesn't work well. It doesn't really force much added boilerplate anyways.
Another abstraction that this doesn't provide is implementing increment in terms of addition of one. These aren't equivalent for all iterator categories, and respecting that adds a lot of complexity for little gain.
Definition at line 38 of file iterator.h.
anonymous enum [protected] |
Definition at line 42 of file iterator.h.
bool llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator!= | ( | const DerivedT & | RHS | ) | const [inline] |
Definition at line 96 of file iterator.h.
DerivedT llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator+ | ( | DifferenceTypeT | n | ) | const [inline] |
Definition at line 50 of file iterator.h.
DerivedT& llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator++ | ( | ) | [inline] |
Reimplemented in llvm::LazyCallGraph::postorder_scc_iterator, llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT, WrappedTraitsT >, llvm::iterator_adaptor_base< value_op_iterator, op_iterator, std::random_access_iterator_tag, Value *, ptrdiff_t, Value *, Value * >, llvm::iterator_adaptor_base< iterator, NodeVectorImplT::iterator, std::forward_iterator_tag, Node >, llvm::iterator_adaptor_base< pointee_iterator< WrappedIteratorT >, WrappedIteratorT, std::iterator_traits< WrappedIteratorT >::iterator_category, T >, llvm::LazyCallGraph::iterator, and llvm::scc_iterator< GraphT, GT >.
Definition at line 73 of file iterator.h.
DerivedT llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator++ | ( | int | ) | [inline] |
Definition at line 76 of file iterator.h.
DerivedT llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator- | ( | DifferenceTypeT | n | ) | const [inline] |
Definition at line 64 of file iterator.h.
DerivedT& llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-- | ( | ) | [inline] |
Reimplemented in llvm::iterator_adaptor_base< DerivedT, WrappedIteratorT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT, WrappedTraitsT >, llvm::iterator_adaptor_base< value_op_iterator, op_iterator, std::random_access_iterator_tag, Value *, ptrdiff_t, Value *, Value * >, llvm::iterator_adaptor_base< iterator, NodeVectorImplT::iterator, std::forward_iterator_tag, Node >, and llvm::iterator_adaptor_base< pointee_iterator< WrappedIteratorT >, WrappedIteratorT, std::iterator_traits< WrappedIteratorT >::iterator_category, T >.
Definition at line 81 of file iterator.h.
DerivedT llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-- | ( | int | ) | [inline] |
Definition at line 87 of file iterator.h.
PointerT llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator-> | ( | ) | const [inline] |
Reimplemented in llvm::User::value_op_iterator.
Definition at line 120 of file iterator.h.
bool llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator<= | ( | const DerivedT & | RHS | ) | const [inline] |
Definition at line 107 of file iterator.h.
bool llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator> | ( | const DerivedT & | RHS | ) | const [inline] |
Definition at line 100 of file iterator.h.
bool llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator>= | ( | const DerivedT & | RHS | ) | const [inline] |
Definition at line 113 of file iterator.h.
ReferenceT llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >::operator[] | ( | DifferenceTypeT | n | ) | const [inline] |
Definition at line 123 of file iterator.h.
DerivedT operator+ | ( | DifferenceTypeT | n, |
const DerivedT & | i | ||
) | [friend] |
Definition at line 58 of file iterator.h.