Skip to content

Commit a8e7afa

Browse files
committed
cpplint
1 parent 10ee076 commit a8e7afa

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

stan/math/prim/fun/promote_scalar.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <stan/math/prim/fun/Eigen.hpp>
55
#include <stan/math/prim/meta.hpp>
6+
#include <stan/math/prim/functor/apply.hpp>
67
#include <vector>
78
#include <tuple>
89
#include <type_traits>
@@ -12,11 +13,12 @@ namespace math {
1213

1314
template <typename PromotionScalars, typename UnPromotedTypes>
1415
inline constexpr auto promote_scalar(UnPromotedTypes&& x) {
15-
if constexpr (std::is_same_v<PromotionScalars,
16-
scalar_type_t<UnPromotedTypes>>) {
16+
using unpromoted_scalar_t = scalar_type_t<UnPromotedTypes>;
17+
constexpr bool both_tuples = is_tuple_v<PromotionScalars> &&
18+
is_tuple_v<UnPromotedTypes>;
19+
if constexpr (std::is_same_v<PromotionScalars,unpromoted_scalar_t>) {
1720
return std::forward<UnPromotedTypes>(x);
18-
} else if constexpr (is_tuple_v<
19-
PromotionScalars> && is_tuple_v<UnPromotedTypes>) {
21+
} else if constexpr (both_tuples) {
2022
return index_apply<std::tuple_size<std::decay_t<UnPromotedTypes>>::value>(
2123
[&x](auto... Is) {
2224
return std::make_tuple(

stan/math/prim/functor/filter_map.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ inline constexpr decltype(auto) filter_map(F&& f, T&& x) {
6060
}
6161
} else if constexpr (is_std_vector_v<T>) {
6262
if constexpr (contains_tuple<T>::value) {
63-
using value_type = value_type_t<T>;
6463
/* 3 cases
6564
* 1. value_type is a scalar or Eigen matrix
6665
* 2. value_type is a tuple

0 commit comments

Comments
 (0)