From d7e72a09e02277649df8cf8e47ddc66d5f34c037 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 18 Dec 2019 11:50:47 -0800 Subject: [PATCH] Simplify FMT_STRING_IMPL --- include/fmt/format.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 2c1cc3ce..5daa238a 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3447,18 +3447,17 @@ FMT_CONSTEXPR internal::udl_arg operator"" _a(const wchar_t* s, #endif // FMT_USE_USER_DEFINED_LITERALS FMT_END_NAMESPACE -#define FMT_STRING_IMPL(s, ...) \ - [] { \ - /* Use a macro-like name to avoid shadowing warnings. */ \ - struct FMT_STRING : fmt::compile_string { \ - using char_type = typename std::remove_cv::type>::type>::type; \ - __VA_ARGS__ FMT_CONSTEXPR \ - operator fmt::basic_string_view() const { \ - return {s, sizeof(s) / sizeof(char_type) - 1}; \ - } \ - }; \ - return FMT_STRING(); \ +#define FMT_STRING_IMPL(s, ...) \ + [] { \ + /* Use a macro-like name to avoid shadowing warnings. */ \ + struct FMT_STRING : fmt::compile_string { \ + using char_type = fmt::remove_cvref_t; \ + __VA_ARGS__ FMT_CONSTEXPR \ + operator fmt::basic_string_view() const { \ + return {s, sizeof(s) / sizeof(char_type) - 1}; \ + } \ + }; \ + return FMT_STRING(); \ }() /**