yat  0.20.3pre
Public Types | Public Member Functions | Friends | List of all members
theplu::yat::utility::StrideIterator< RandomAccessIterator > Class Template Reference

Adaptor using a stride on underlying iterator. More...

#include <yat/utility/StrideIterator.h>

Inheritance diagram for theplu::yat::utility::StrideIterator< RandomAccessIterator >:

Public Types

typedef RandomAccessIterator iterator_type
 type of underlying iterator
 

Public Member Functions

 StrideIterator (size_t stride=1)
 default constructor More...
 
 StrideIterator (RandomAccessIterator p, size_t stride=1)
 Constructor.
 
 StrideIterator (const StrideIterator &other)
 Copy constructor.
 
template<typename I2 >
 StrideIterator (StrideIterator< I2 > other, typename boost::enable_if_convertible< I2, RandomAccessIterator >::type *=0)
 Conversion constructor. More...
 
StrideIteratoroperator= (const StrideIterator &rhs)
 Assignment operator.
 
size_t stride (void) const
 

Friends

class boost::iterator_core_access
 

Detailed Description

template<typename RandomAccessIterator>
class theplu::yat::utility::StrideIterator< RandomAccessIterator >

Adaptor using a stride on underlying iterator.

Works as underlying iterator except that all arithmetic uses the stride, so e.g., ++StrideIterator returns underlying _iterator+stride

The stride must be positive. Negative stride can be accomplished by combining StrideIterator with a reverse_iterator (from e.g. std or boost).

Type Requirements:

Constructor & Destructor Documentation

◆ StrideIterator() [1/2]

template<typename RandomAccessIterator>
theplu::yat::utility::StrideIterator< RandomAccessIterator >::StrideIterator ( size_t  stride = 1)
inlineexplicit

default constructor

Using default constructor of BASE iterator.

◆ StrideIterator() [2/2]

template<typename RandomAccessIterator>
template<typename I2 >
theplu::yat::utility::StrideIterator< RandomAccessIterator >::StrideIterator ( StrideIterator< I2 >  other,
typename boost::enable_if_convertible< I2, RandomAccessIterator >::type *  = 0 
)
inline

Conversion constructor.

Create a StrideIterator<RandomAccessIterator> from a StrideIterator<I2>. Possible if I2 is convertible to a RandomAccessIterator. Constructor allows implicit conversions such as iterator to const_iterator.

Member Function Documentation

◆ stride()

template<typename RandomAccessIterator>
size_t theplu::yat::utility::StrideIterator< RandomAccessIterator >::stride ( void  ) const
inline
Returns
stride

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

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14