From 94ab51cb8c63c93220f0cdd1733bdeef95e77d60 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 14 Feb 2025 03:02:09 -0700 Subject: [PATCH] Simplify implementation of `operator""_cf` (#4349) --- include/fmt/compile.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/include/fmt/compile.h b/include/fmt/compile.h index 3a341f23..08d9427f 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -41,16 +41,6 @@ namespace detail { # define FMT_COMPILE(s) FMT_STRING(s) #endif -#if FMT_USE_NONTYPE_TEMPLATE_ARGS -template Str> -struct udl_compiled_string : compiled_string { - using char_type = Char; - constexpr explicit operator basic_string_view() const { - return {Str.data, N - 1}; - } -}; -#endif - template auto first(const T& value, const Tail&...) -> const T& { return value; @@ -538,9 +528,7 @@ void print(const S& fmt, const Args&... args) { #if FMT_USE_NONTYPE_TEMPLATE_ARGS inline namespace literals { template constexpr auto operator""_cf() { - using char_t = remove_cvref_t; - return detail::udl_compiled_string(); + return FMT_COMPILE(Str.data); } } // namespace literals #endif