Automatic Differentiation
 
Loading...
Searching...
No Matches
tuple_size.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_TUPLE_SIZE_HPP
2#define STAN_MATH_PRIM_META_TUPLE_SIZE_HPP
3
5#include <type_traits>
6#include <cstddef>
7#include <tuple>
8
9namespace stan {
10
16template <typename T, typename = void>
17struct tuple_size : std::integral_constant<std::size_t, 0> {};
18
19template <typename T>
20struct tuple_size<T, std::enable_if_t<stan::is_tuple_v<T>>>
21 : std::integral_constant<std::size_t, std::tuple_size_v<std::decay_t<T>>> {
22};
23
24template <typename T>
26} // namespace stan
27
28#endif
constexpr std::size_t tuple_size_v
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.
Equivalent to std::tuple_size but returns 0 T is not a tuple.