LLVM 22.0.0git
llvm::early_inc_iterator_impl< WrappedIteratorT > Class Template Reference

A pseudo-iterator adaptor that is designed to implement "early increment" style loops. More...

#include "llvm/ADT/STLExtras.h"

Inheritance diagram for llvm::early_inc_iterator_impl< WrappedIteratorT >:
[legend]

Public Member Functions

 early_inc_iterator_impl (WrappedIteratorT I)
decltype(*std::declval< WrappedIteratorT >()) operator* ()
early_inc_iterator_imploperator++ ()
Public Member Functions inherited from llvm::iterator_adaptor_base< early_inc_iterator_impl< WrappedIteratorT >, WrappedIteratorT, std::input_iterator_tag >
early_inc_iterator_impl< WrappedIteratorT > & operator+= (difference_type n)
early_inc_iterator_impl< WrappedIteratorT > & operator-= (difference_type n)
difference_type operator- (const early_inc_iterator_impl< WrappedIteratorT > &RHS) const
early_inc_iterator_impl< WrappedIteratorT > & operator++ ()
early_inc_iterator_impl< WrappedIteratorT > & operator-- ()
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 & > 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
PointerProxy operator-> () const
ReferenceProxy operator[] (DifferenceTypeT n) const

Friends

bool operator== (const early_inc_iterator_impl &LHS, const early_inc_iterator_impl &RHS)

Additional Inherited Members

Public Types inherited from llvm::iterator_adaptor_base< early_inc_iterator_impl< WrappedIteratorT >, WrappedIteratorT, std::input_iterator_tag >
using difference_type
Public Types inherited from llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >
using iterator_category = IteratorCategoryT
using value_type = T
using difference_type = DifferenceTypeT
using pointer = PointerT
using reference = ReferenceT
Protected Types inherited from llvm::iterator_facade_base< DerivedT, IteratorCategoryT, T, DifferenceTypeT, PointerT, ReferenceT >
enum  { IsRandomAccess , IsBidirectional }
Protected Member Functions inherited from llvm::iterator_adaptor_base< early_inc_iterator_impl< WrappedIteratorT >, WrappedIteratorT, std::input_iterator_tag >
 iterator_adaptor_base ()=default
const WrappedIteratorTwrapped () const
Protected Attributes inherited from llvm::iterator_adaptor_base< early_inc_iterator_impl< WrappedIteratorT >, WrappedIteratorT, std::input_iterator_tag >
WrappedIteratorT I

Detailed Description

template<typename WrappedIteratorT>
class llvm::early_inc_iterator_impl< WrappedIteratorT >

A pseudo-iterator adaptor that is designed to implement "early increment" style loops.

This is not a normal iterator and should almost never be used directly. It is intended primarily to be used with range based for loops and some range algorithms.

The iterator isn't quite an OutputIterator or an InputIterator but somewhere between them. The constraints of these iterators are:

  • On construction or after being incremented, it is comparable and dereferencable. It is not incrementable.
  • After being dereferenced, it is neither comparable nor dereferencable, it is only incrementable.

This means you can only dereference the iterator once, and you can only increment it once between dereferences.

Definition at line 578 of file STLExtras.h.

Constructor & Destructor Documentation

◆ early_inc_iterator_impl()

Member Function Documentation

◆ operator*()

template<typename WrappedIteratorT>
decltype(*std::declval< WrappedIteratorT >()) llvm::early_inc_iterator_impl< WrappedIteratorT >::operator* ( )
inline

Definition at line 594 of file STLExtras.h.

References assert().

◆ operator++()

Definition at line 603 of file STLExtras.h.

References assert(), and early_inc_iterator_impl().

◆ operator==

Definition at line 611 of file STLExtras.h.

References assert(), early_inc_iterator_impl(), LHS, and RHS.


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