1#ifndef STAN_MATH_PRIM_FUNCTOR_APPLY_HPP
2#define STAN_MATH_PRIM_FUNCTOR_APPLY_HPP
26template <
class F,
class Tuple,
typename... PreArgs, std::size_t... I>
27inline constexpr decltype(
auto)
apply_impl(F&& f, Tuple&& t,
28 std::index_sequence<I...> ,
29 PreArgs&&... pre_args) {
30 return std::forward<F>(f)(std::forward<PreArgs>(pre_args)...,
31 std::get<I>(std::forward<Tuple>(t))...);
50template <
class F,
class Tuple,
typename... PreArgs>
51inline constexpr decltype(
auto)
apply(F&& f, Tuple&& t, PreArgs&&... pre_args) {
53 std::forward<F>(f), std::forward<Tuple>(t),
54 std::make_index_sequence<
55 std::tuple_size<std::remove_reference_t<Tuple>>{}>{},
56 std::forward<PreArgs>(pre_args)...);
constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence< I... >, PreArgs &&... pre_args)
constexpr decltype(auto) apply(F &&f, Tuple &&t, PreArgs &&... pre_args)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...