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>
28 std::index_sequence<I...> i,
29 PreArgs&&... pre_args) {
30 return std::forward<F>(f)(
31 std::forward<PreArgs>(pre_args)...,
32 std::forward<decltype(std::get<I>(t))>(std::get<I>(t))...);
51template <
class F,
class Tuple,
typename... PreArgs>
52constexpr decltype(
auto)
apply(F&& f, Tuple&& t, PreArgs&&... pre_args) {
54 std::forward<F>(f), std::forward<Tuple>(t),
55 std::make_index_sequence<
56 std::tuple_size<std::remove_reference_t<Tuple>>{}>{},
57 std::forward<PreArgs>(pre_args)...);
constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence< I... > 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 ...