Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function template make_counting_iterator

boost::compute::make_counting_iterator

Synopsis

// In header: <boost/compute/iterator/counting_iterator.hpp>


template<typename T> 
  counting_iterator< T > make_counting_iterator(const T & init);

Description

Returns a new counting_iterator starting at init.

For example, to create a counting iterator which returns unsigned integers and increments from one:

auto iter = make_counting_iterator<uint_>(1);

Parameters:

init

the initial value

Returns:

a counting_iterator with init.


PrevUpHomeNext