...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::strided_iterator — An iterator adaptor with adjustable iteration step.
// In header: <boost/compute/iterator/strided_iterator.hpp> template<typename Iterator> class strided_iterator { public: // types typedef unspecified super_type; typedef super_type::value_type value_type; typedef super_type::reference reference; typedef super_type::base_type base_type; typedef super_type::difference_type difference_type; // construct/copy/destruct strided_iterator(Iterator, difference_type); strided_iterator(const strided_iterator< Iterator > &); strided_iterator< Iterator > & operator=(const strided_iterator< Iterator > &); ~strided_iterator(); // public member functions size_t get_index() const; const buffer & get_buffer() const; template<typename IndexExpression> unspecified operator[](const IndexExpression &) const; // private member functions reference dereference() const; bool equal(const strided_iterator< Iterator > &) const; void increment(); void decrement(); void advance(typename super_type::difference_type); difference_type distance_to(const strided_iterator< Iterator > &) const; };
The strided iterator adaptor skips over multiple elements each time it is incremented or decremented.
See Also:
buffer_iterator, make_strided_iterator(), make_strided_iterator_end()
strided_iterator
public
construct/copy/destructstrided_iterator(Iterator iterator, difference_type stride);
strided_iterator(const strided_iterator< Iterator > & other);
strided_iterator< Iterator > & operator=(const strided_iterator< Iterator > & other);
~strided_iterator();
strided_iterator
private member functionsreference dereference() const;
bool equal(const strided_iterator< Iterator > & other) const;
void increment();
void decrement();
void advance(typename super_type::difference_type n);
difference_type distance_to(const strided_iterator< Iterator > & other) const;