boost::compute::counting_iterator
// In header: <boost/compute/iterator/counting_iterator.hpp> template<typename T> class counting_iterator { public: // types typedef unspecified super_type; typedef super_type::reference reference; typedef super_type::difference_type difference_type; // construct/copy/destruct counting_iterator(const T &); counting_iterator(const counting_iterator< T > &); counting_iterator< T > & operator=(const counting_iterator< T > &); ~counting_iterator(); // public member functions size_t get_index() const; template<typename Expr> unspecified operator[](const Expr &) const; // private member functions reference dereference() const; bool equal(const counting_iterator< T > &) const; void increment(); void decrement(); void advance(difference_type); difference_type distance_to(const counting_iterator< T > &) const; };