diff --git a/stan/math/prim/fun/num_elements.hpp b/stan/math/prim/fun/num_elements.hpp index 1e01328e5e2..07be5041c29 100644 --- a/stan/math/prim/fun/num_elements.hpp +++ b/stan/math/prim/fun/num_elements.hpp @@ -57,7 +57,7 @@ template * = nullptr> inline size_t num_elements(const std::vector& 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; } @@ -71,9 +71,12 @@ inline size_t num_elements(const std::vector& v) { template * = nullptr> inline size_t num_elements(const T& v) { size_t size = 0; - math::apply([&size](auto&&... args) { - static_cast( - std::initializer_list{(size += num_elements(args), 0)...}); }, v); + math::apply( + [&size](auto&&... args) { + static_cast( + std::initializer_list{(size += num_elements(args), 0)...}); + }, + v); return size; }