From 1dfa2591b3873a67bf5cd2fdb71d00b570096c51 Mon Sep 17 00:00:00 2001 From: Charles Milette Date: Sat, 27 Jul 2019 18:04:51 -0400 Subject: [PATCH] Make operator _a constexpr --- include/fmt/format.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index a3e9e6e4..7d274fac 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3527,11 +3527,13 @@ FMT_CONSTEXPR internal::udl_formatter operator"" _format( fmt::print("Elapsed time: {s:.2f} seconds", "s"_a=1.23); \endrst */ -inline internal::udl_arg operator"" _a(const char* s, std::size_t) { - return {s}; +FMT_CONSTEXPR internal::udl_arg operator"" _a(const char* s, + std::size_t n) { + return {{s, n}}; } -inline internal::udl_arg operator"" _a(const wchar_t* s, std::size_t) { - return {s}; +FMT_CONSTEXPR internal::udl_arg operator"" _a(const wchar_t* s, + std::size_t n) { + return {{s, n}}; } } // namespace literals #endif // FMT_USE_USER_DEFINED_LITERALS