std::forward_as_tuple (3) - Linux Manuals
std::forward_as_tuple: std::forward_as_tuple
NAME
std::forward_as_tuple - std::forward_as_tuple
Synopsis
Defined in header <tuple>
template< class... Types > (since C++11)
tuple<Types&&...> forward_as_tuple( Types&&... args ) noexcept; (constexpr since C++14)
Constructs a tuple of references to the arguments in args suitable for forwarding as an argument to a function. The tuple has rvalue reference data members when rvalues are used as arguments, and otherwise has lvalue reference data members.
Parameters
args - zero or more arguments to construct the tuple from
Return value
A std::tuple object created as if by std::tuple<Types&&...>(std::forward<Types>(args)...)
Notes
If the arguments are temporaries, forward_as_tuple does not extend their lifetime; they have to be used before the end of the full expression.
Example
// Run this code
Output:
See also
make_tuple (function template)
tie (function template)
tuple_cat (function template)
apply calls a function with a tuple of arguments
(C++17)