| Home | Libraries | People | FAQ | More

## Function template make_strided_iterator

boost::compute::make_strided_iterator

## Synopsis

    // 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);

## Description

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:

`iterator` | the underlying iterator
`stride` | the iteration step for `strided_iterator`

Returns: | a `strided_iterator` for `iterator` with `stride`.