cuda::experimental::stf::tuple_prepend

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

template<typename T, typename ...P>
constexpr auto cuda::experimental::stf::tuple_prepend(T &&prefix, ::std::tuple<P...> tuple)

Prepends an element to a tuple.

This function creates a new tuple by prepending the element t to the tuple p.

Example:

int a = 1;
std::tuple<int, double, char> t = std::make_tuple(2, 3.0, 'c');
auto result = tuple_prepend(a, t);
// result is std::tuple<int, int, double, char>(1, 2, 3.0, 'c')

Template Parameters
  • T – The type of the element to prepend.

  • P – The types of the elements in the tuple.

Parameters
  • prefix – The element to prepend.

  • tuple – The tuple to which the element is prepended.

Returns

std::tuple<T, P…> A new tuple with t prepended to p.