thrust::sequence
Defined in thrust/sequence.h
- 
template<typename ForwardIterator, typename T>
 void thrust::sequence(ForwardIterator first, ForwardIterator last, T init)
- sequencefills the range- [first, last)with a sequence of numbers.- For each iterator - iin the range- [first, last), this version of- sequenceperforms the assignment- *i = init + (i - first).- The following code snippet demonstrates how to use - sequenceto fill a range with a sequence of numbers starting from the value 1.- #include <thrust/sequence.h> ... const int N = 10; int A[N]; thrust::sequence(A, A + 10, 1); // A is now {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} - Note - Unlike the similar C++ STL function - std::iota,- sequenceoffers no guarantee on order of execution.- Parameters
- first – The beginning of the sequence. 
- last – The end of the sequence. 
- init – The first value of the sequence of numbers. 
 
- Template Parameters
- ForwardIterator – is a model of Forward Iterator, and - ForwardIteratoris mutable, and if- xand- yare objects of- ForwardIterator's- value_type, then- x + yis defined, and if- Tis- ForwardIterator's- value_type, then- T(0)is defined.
- T – is a model of Assignable, and - Tis convertible to- ForwardIterator's- value_type.