From 156744ad477dbcccb014813563e1ec53fd4dc81d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 29 May 2022 21:18:52 -0700 Subject: [PATCH] Simplify fmt::runtime --- include/fmt/core.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index e36bbe3a..762155c4 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -3080,10 +3080,8 @@ template class basic_format_string { #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 // Workaround broken conversion on older gcc. -template using format_string = string_view; -template auto runtime(const S& s) -> basic_string_view> { - return s; -} +template using format_string = string_view; +inline auto runtime(string_view s) -> basic_string_view { return s; } #else template using format_string = basic_format_string...>; @@ -3097,9 +3095,7 @@ using format_string = basic_format_string...>; fmt::print(fmt::runtime("{:d}"), "I am not a number"); \endrst */ -template auto runtime(const S& s) -> basic_runtime> { - return {{s}}; -} +inline auto runtime(string_view s) -> basic_runtime { return {{s}}; } #endif FMT_API auto vformat(string_view fmt, format_args args) -> std::string;