cuda::experimental::stf::tuple_transform#
-
template<typename Tuple, typename F>
constexpr auto cuda::experimental::stf::tuple_transform(
)# Applies a transformation to each element of a tuple, optionally passing the index.
Iterates over the elements of a tuple and applies the provided functor
fto each element. Iffis invocable with both the index and the element (f(index, element)), that form is used. Otherwise, it falls back tof(element). The index is a compile-time constant of typestd::integral_constant<std::size_t, i>, whereiis the index of the element in the tuple.- Template Parameters:
Tuple – The type of the input tuple.
F – The type of the transformation functor.
- Parameters:
t – The input tuple to transform.
f – The transformation functor. Must be invocable with either
f(element)orf(index, element).
- Returns:
A new tuple containing the results of applying
fto each element oft.