Template Function ripple::make_tuple¶
Function Documentation¶
-
template<typename ...
Ts
>
constexpr autoripple
::
make_tuple
(Ts&&... values) noexcept -> Tuple<std::decay_t<Ts>...>¶ This makes a tuple, and is the interface through which tuples should be created in almost all cases.
Example usage is:
auto tuple = make_tuple(4, 3.5, "some value");
This imlementation decays the types, so it will not create refrence types, i.e:
int x = 4, y = 5; auto tup = make_tuple(x, y);
will copy
x
andy
and not create a tuple of references to the variables. This is done so that in the default case the tuple can be used on both the host and device, and passed to kernels.int x = 0, y = 0.0f; Tuple<int&, float&> tuple{x, y}; // Can modify x and y though tuple: get<0>(tuple) = 4; get<1>(tuple) = 3.5f; // Can modify tuple values though x and y: x = 0; y = 0.0f;
- Note
If references are required, then explicit creation of the tuple should be used:
- Return
A tuple containing the values.
- Parameters
values
: The values to store in the tuple.
- Template Parameters
Ts
: The types of the values for the tuple.