cuda::experimental::stf::each_in_tuple

Defined in include/cuda/experimental/__stf/utility/core.cuh

template<typename Tuple, typename F>
constexpr void cuda::experimental::stf::each_in_tuple(Tuple &&t, F &&f)

Iterates over the elements of a tuple, applying a given function object to each element.

The function each_in_tuple accepts a tuple and a callable object f. If f accepts two parameters, it is invoked with the index as a std::integral_constant and the value at that index in the tuple for each element. If f accepts only one parameter, it is invoked with the value at each index in the tuple.

Template Parameters
  • Tuple – The type of the tuple over which to iterate.

  • F – The type of the callable object to apply to each element in the tuple.

  • i... – An optional parameter pack representing indices (used internally in the recursive implementation).

Parameters
  • t – The tuple over which to iterate.

  • f – The callable object to apply to each element in the tuple.

  • std::index_sequence<i...> – An optional index sequence used internally in the recursive implementation (default-constructed as empty).