From 943532fecee35f3d0f8fda7fa8431a85b36c50ce Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 20 May 2020 14:59:57 -0700 Subject: [PATCH] Make ostream formatter work with compile-time format strings (#1692) --- include/fmt/ostream.h | 3 ++- test/ostream-test.cc | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 597316d8..72ba1da0 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -110,7 +110,8 @@ void format_value(buffer& buf, const T& value, template struct fallback_formatter::value>> : private formatter, Char> { - auto parse(basic_format_parse_context& ctx) -> decltype(ctx.begin()) { + FMT_CONSTEXPR auto parse(basic_format_parse_context& ctx) + -> decltype(ctx.begin()) { return formatter, Char>::parse(ctx); } template