...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::make_strided_iterator
// In header: <boost/compute/iterator/strided_iterator.hpp> template<typename Iterator> strided_iterator< Iterator > make_strided_iterator(Iterator iterator, typename std::iterator_traits< Iterator >::difference_type stride);
Returns a strided_iterator
for iterator
with stride
.
For example, to create an iterator which iterates over every other element in a vector<int>
:
auto strided_iterator = make_strided_iterator(vec.begin(), 2);
Parameters: |
|
||||
Returns: |
a |