From 25d6916b3ae5602a5cb1cf1bb8be1de3d2ecbd0f Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 21 Jan 2020 09:02:19 -0700 Subject: [PATCH] Fix so can work without locale defined If `FMT_STATIC_THOUSANDS_SEPARATOR` defined, then locale is not included or defined, so this call will be unresolved. I think this is the correct fix based on the code in `format-inl.h` and `format.h` --- include/fmt/ostream.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 75a8cd4b..c4831533 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -93,7 +93,9 @@ void format_value(buffer& buf, const T& value, locale_ref loc = locale_ref()) { formatbuf format_buf(buf); std::basic_ostream output(&format_buf); + #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) if (loc) output.imbue(loc.get()); + #endif output.exceptions(std::ios_base::failbit | std::ios_base::badbit); output << value; buf.resize(buf.size());