Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ shallow_copy_vargs()

template<typename PromotedType , typename... Args>
auto stan::math::internal::shallow_copy_vargs ( Args &&...  args)
inline

Conditional shallow copy types with a var scalar type to PromotedType.

Note
This function is useful whenever you are inside of nested autodiff and want to allow the input arguments from an outer autodiff to be used in an inner autodiff without making a hard copy of the input arguments.
Template Parameters
PromotedTypetype to promote the scalar to.
Argsvariadic arguments.
Parameters
argsvariadic arguments to conditionally copy and promote.
Returns
a tuple where each element is either a reference to the original argument or a promoted copy of the argument.

Definition at line 98 of file conditional_copy_and_promote.hpp.