thrust::iterator_facade
Defined in thrust/iterator/iterator_facade.h
- 
template<typename Derived, typename Value, typename System, typename Traversal, typename Reference, typename Difference = ::cuda::std::ptrdiff_t>
 class iterator_facade
- iterator_facadeis a template which allows the programmer to define a novel iterator with a standards-conforming interface which Thrust can use to reason about algorithm acceleration opportunities.- Because most of a standard iterator’s interface is defined in terms of a small set of core primitives, - iterator_facadedefines the non-primitive portion mechanically. In principle a novel iterator could explicitly provide the entire interface in an ad hoc fashion but doing so might be tedious and prone to subtle errors.- Often - iterator_facadeis too primitive a tool to use for defining novel iterators. In these cases,- iterator_adaptoror a specific fancy iterator should be used instead.- iterator_facade'sfunctionality is derived from and generally equivalent to- boost::iterator_facade. The exception is Thrust’s addition of the template parameter- System, which is necessary to allow Thrust to dispatch an algorithm to one of several parallel backend systems. An additional exception is Thrust’s omission of the- operator->member function.- Interested users may refer to - boost::iterator_facade’s documentation for usage examples.- Note - iterator_facade'sarithmetic operator free functions exist with the usual meanings but are omitted here for brevity.- Public Types - 
using value_type = ::cuda::std::remove_const_t<Value>
- The type of element pointed to by - iterator_facade.
 - 
using reference = Reference
- The return type of - iterator_facade::operator*().
 - 
using pointer = void
- The return type of - iterator_facade'snon-existent- operator->()member function. Unlike- boost::iterator_facade,- iterator_facadedisallows access to the- value_type'smembers through expressions of the form- iter->member.- pointeris defined to- voidto indicate that these expressions are not allowed. This limitation may be relaxed in a future version of Thrust.
 - 
using difference_type = Difference
- The type of expressions of the form - x - ywhere- xand- yare of type- iterator_facade.
 - Public Functions - 
inline reference operator*() const
- operator*()dereferences this- iterator_facade.- Returns
- A reference to the element pointed to by this - iterator_facade.
 
 - 
inline reference operator[](difference_type n) const
- operator[] performs indexed dereference.- Returns
- A reference to the element - ndistance away from this- iterator_facade.
 
 - 
inline Derived &operator++()
- operator++pre-increments this- iterator_facadeto refer to the element in the next position.- Returns
- *this
 
 - 
inline Derived operator++(int)
- operator++post-increments this- iterator_facadeand returns a new- iterator_facadereferring to the element in the next position.- Returns
- A copy of - *thisbefore increment.
 
 - 
inline Derived &operator--()
- operator--pre-decrements this- iterator_facadeto refer to the element in the previous position.- Returns
- *this
 
 - 
inline Derived operator--(int)
- operator--post-decrements this- iterator_facadeand returns a new- iterator_facadereferring to the element in the previous position.- Returns
- A copy of - *thisbefore decrement.
 
 - 
inline Derived &operator+=(difference_type n)
- operator+=increments this- iterator_facadeto refer to an element a given distance after its current position.- Parameters
- n – The quantity to increment. 
- Returns
- *this
 
 - 
inline Derived &operator-=(difference_type n)
- operator-=decrements this- iterator_facadeto refer to an element a given distance before its current position.- Parameters
- n – The quantity to decrement. 
- Returns
- *this
 
 - 
inline Derived operator-(difference_type n) const
- operator-subtracts a given quantity from this- iterator_facadeand returns a new- iterator_facadereferring to the element at the given position before this- iterator_facade.- Parameters
- n – The quantity to decrement 
- Returns
- An - iterator_facadepointing- nelements before this- iterator_facade.
 
 
- 
using value_type = ::cuda::std::remove_const_t<Value>