Skip to content

Commit

Permalink
Add forward declaration to stan_print.hpp
Browse files Browse the repository at this point in the history
Fixes printing arrays-of-tuples
  • Loading branch information
WardBrian committed Jul 25, 2023
1 parent 2e87eca commit d29f5f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stan/math/prim/fun/stan_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ void stan_print(std::ostream* o, const EigMat& x) {
*o << ']';
}

// forward decl to allow the next two overloads to call each other
template <typename T, require_tuple_t<T>* = nullptr>
void stan_print(std::ostream* o, const T& x);

template <typename T, require_std_vector_t<T>* = nullptr>
void stan_print(std::ostream* o, const T& x) {
*o << '[';
Expand Down

0 comments on commit d29f5f9

Please sign in to comment.