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

◆ make_holder()

template<typename F , typename... Args, require_not_plain_type_t< decltype(std::declval< F >()(std::declval< Args & >()...))> * = nullptr>
auto stan::math::make_holder ( const F &  func,
Args &&...  args 
)

Constructs an expression from given arguments using given functor.

Calls given function with given arguments.

This is similar to calling the functor with given arguments. Except that any rvalue argument will be moved to heap first. The arguments moved to heap are deleted once the expression is destructed.

Template Parameters
Ftype of the functor
Argstypes of the arguments
Parameters
functhe functor
argsarguments for the functor
Returns
holder referencing expression constructed by given functor

No holder is necessary if the function is not returning Eigen expression.

Template Parameters
Ftype of the functor
Argstypes of the arguments
Parameters
functhe functor
argsarguments for the functor
Returns
holder referencing expression constructed by given functor

Definition at line 352 of file holder.hpp.