Skip to content

Commit

Permalink
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-buildbot committed May 2, 2024
1 parent a393166 commit a6da9d3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions stan/math/prim/fun/num_elements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ template <typename T, require_container_t<T>* = nullptr>
inline size_t num_elements(const std::vector<T>& v) {
size_t size = 0;
std::for_each(v.cbegin(), v.cend(),
[&size](auto&& x){ size += num_elements(x); });
[&size](auto&& x) { size += num_elements(x); });
return size;
}

Expand All @@ -71,9 +71,12 @@ inline size_t num_elements(const std::vector<T>& v) {
template <typename T, require_tuple_t<T>* = nullptr>
inline size_t num_elements(const T& v) {
size_t size = 0;
math::apply([&size](auto&&... args) {
static_cast<void>(
std::initializer_list<int>{(size += num_elements(args), 0)...}); }, v);
math::apply(
[&size](auto&&... args) {
static_cast<void>(
std::initializer_list<int>{(size += num_elements(args), 0)...});
},
v);
return size;
}

Expand Down

0 comments on commit a6da9d3

Please sign in to comment.