cuda::experimental::stf::tuple2tuple#
-
template<typename Tuple, typename Fun>
constexpr auto cuda::experimental::stf::tuple2tuple(
)# Converts each element in
tto a new value by callingf, then returns a tuple collecting the values thus obtained.auto t = ::std::make_tuple(1, 2, 3); auto t1 = tuple2tuple(t, [](auto x) { return x + 1.0; }); static_assert(::std::is_same_v<decltype(t1), ::std::tuple<double, double, double>>); EXPECT(t1 == ::std::make_tuple(2.0, 3.0, 4.0));
- Template Parameters:
Tuple – Type of the tuple to convert
Fun – Type of mapping function to apply
- Parameters:
t – Object to convert, must support
std::applyf – function to convert each element of the tuple, must take a single parameter
- Returns:
auto The tuple resulting from the mapping