make_constant_iterator#

Overloads#

make_constant_iterator(x, i=int())#

template<typename ValueT, typename IndexT>
inline constant_iterator<ValueT, IndexT> thrust::make_constant_iterator(
ValueT x,
IndexT i = int(),
)#

This version of make_constant_iterator creates a constant_iterator from values given for both value and index.

The type of constant_iterator may be inferred by the compiler from the types of its parameters.

Parameters:
  • x – The value of the returned constant_iterator's constant value.

  • i – The index of the returned constant_iterator within a sequence. The type of this parameter defaults to int. In the default case, the value of this parameter is 0.

Returns:

A new constant_iterator with constant value & index as given by x & i.

make_constant_iterator(x)#

template<typename V>
inline constant_iterator<V> thrust::make_constant_iterator(
V x,
)#

This version of make_constant_iterator creates a constant_iterator using only a parameter for the desired constant value.

The value of the returned constant_iterator's index is set to 0.

Parameters:

x – The value of the returned constant_iterator's constant value.

Returns:

A new constant_iterator with constant value equal to x and index equal to 0.