![]() |
Stan Math Library
5.1.0
Automatic Differentiation
|
|
inlineconstexpr |
Holds ownership of rvalues and forwards lvalues into a tuple.
Constructs a tuple from the provided arguments such that:
This behavior ensures that temporaries are stored by value in the tuple while lvalues are preserved as references. It is similar in intent to the Holder
class in behavior, but for tuples instead of Eigen types. It is the opposite of std::forward_as_tuple
, with the difference in handling rvalues. std::forward_as_tuple
does not extend object lifetimes, so when an rvalue is passed to std::forward_as_tuple
, the resulting tuple element will be a reference to a temporary that is destroyed at the end of the statement. This function ensures that rvalues are stored by value in the tuple, extending their lifetimes.
Types | Parameter pack representing the types of the arguments. |
args | The arguments to forward into the tuple. |
Definition at line 66 of file make_holder_tuple.hpp.