Automatic Differentiation
 
Loading...
Searching...
No Matches
tuple_element.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_TUPLE_ELEMENT_HPP
2#define STAN_MATH_PRIM_META_TUPLE_ELEMENT_HPP
3
6
7#include <type_traits>
8#include <cstddef>
9#include <tuple>
10
11namespace stan {
12
20template <std::size_t N, typename T, typename = void>
22 using type = void;
23};
24
25template <std::size_t N, typename T>
27 N, T,
28 std::enable_if_t<stan::is_tuple_v<T> && (N < stan::tuple_size_v<T>)>> {
29 using type = std::tuple_element_t<N, std::decay_t<T>>;
30};
31
32template <std::size_t N, typename T>
34} // namespace stan
35
36#endif
typename stan::tuple_element< N, T >::type tuple_element_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.
Equivalent to std::tuple_element but returns void if N is out of range to avoid a static assertion fa...