File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22#define STAN_MATH_PRIM_FUN_PROMOTE_SCALAR_HPP
33
44#include < stan/math/prim/fun/Eigen.hpp>
5- #include < stan/math/prim/meta.hpp>
65#include < stan/math/prim/functor/apply.hpp>
6+ #include < stan/math/prim/meta.hpp>
77#include < vector>
88#include < tuple>
99#include < type_traits>
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ namespace stan {
77namespace internal {
88template <typename T>
99struct contains_tuple_impl {
10- static constexpr bool value = stan::is_tuple_v<T>;
10+ static constexpr bool value = stan::math:: is_tuple_v<T>;
1111};
1212
1313template <typename T, typename ... VecArgs>
Original file line number Diff line number Diff line change 66#include < type_traits>
77
88namespace stan {
9+ namespace math {
910namespace internal {
1011
1112template <typename ... Types>
@@ -20,7 +21,6 @@ struct is_tuple : internal::is_tuple_impl<std::decay_t<T>> {};
2021
2122template <typename T>
2223constexpr bool is_tuple_v = is_tuple<T>::value;
23-
2424/* ! \ingroup require_std */
2525/* ! \defgroup tuple_types tuple */
2626/* ! \addtogroup tuple_types */
@@ -47,6 +47,7 @@ template <typename... Types>
4747using require_all_not_tuple_t
4848 = require_all_not_t <is_tuple<std::decay_t <Types>>...>;
4949/* ! @} */
50+ }
5051
5152} // namespace stan
5253
Original file line number Diff line number Diff line change @@ -49,20 +49,6 @@ struct arena_type_impl<
4949 using type = plain_type_t <T>;
5050};
5151
52- template <typename T, typename = void >
53- struct arena_tuple_impl {};
54-
55- template <typename T>
56- struct arena_tuple_impl <T, stan::require_not_tuple_t <T>> {
57- using type = typename internal::arena_type_impl<std::decay_t <T>>::type;
58- };
59-
60- template <typename ... Types>
61- struct arena_tuple_impl <std::tuple<Types...>> {
62- using type = std::tuple<
63- typename internal::arena_tuple_impl<std::decay_t <Types>>::type...>;
64- };
65-
6652} // namespace internal
6753
6854/* *
@@ -73,10 +59,6 @@ struct arena_tuple_impl<std::tuple<Types...>> {
7359template <typename T>
7460using arena_t = typename internal::arena_type_impl<std::decay_t <T>>::type;
7561
76- template <typename T>
77- using arena_tuple_t =
78- typename internal::arena_tuple_impl<std::decay_t <T>>::type;
79-
8062} // namespace stan
8163
8264#endif
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ inline double get_val(T&& x) {
3030 */
3131template <typename F, typename ... Types>
3232inline void recursive_for_each (F&& f, Types&&... args) {
33- if constexpr (std::conjunction_v<stan::is_tuple<Types>...>) {
33+ if constexpr (std::conjunction_v<stan::math:: is_tuple<Types>...>) {
3434 stan::math::for_each (
3535 [&f](auto &&... args_i) { recursive_for_each (f, args_i...); }, args...);
3636 } else {
Original file line number Diff line number Diff line change 44#include < vector>
55
66TEST (MathMetaPrim, is_tuple) {
7- EXPECT_TRUE ((stan::is_tuple<std::tuple<double >>::value));
8- EXPECT_TRUE ((stan::is_tuple<std::tuple<double >&>::value));
9- EXPECT_TRUE ((stan::is_tuple<std::tuple<double >&&>::value));
10- EXPECT_FALSE ((stan::is_tuple<double >::value));
11- EXPECT_FALSE ((stan::is_tuple<std::vector<double >>::value));
7+ EXPECT_TRUE ((stan::math:: is_tuple<std::tuple<double >>::value));
8+ EXPECT_TRUE ((stan::math:: is_tuple<std::tuple<double >&>::value));
9+ EXPECT_TRUE ((stan::math:: is_tuple<std::tuple<double >&&>::value));
10+ EXPECT_FALSE ((stan::math:: is_tuple<double >::value));
11+ EXPECT_FALSE ((stan::math:: is_tuple<std::vector<double >>::value));
1212}
You can’t perform that action at this time.
0 commit comments