From e9753251e2d5b0741f9b2f3e1f0ada6b235a0651 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Fri, 7 Jun 2024 23:20:53 +0800 Subject: [PATCH] Export `compiled_string` so that user can customize one --- include/fmt/compile.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/fmt/compile.h b/include/fmt/compile.h index 9f69fcbb695b..d77de3581839 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -15,6 +15,10 @@ #include "format.h" FMT_BEGIN_NAMESPACE + +// A compile-time string which is compiled into fast formatting code. +FMT_EXPORT class compiled_string {}; + namespace detail { template @@ -23,9 +27,6 @@ FMT_CONSTEXPR inline auto copy(InputIt begin, InputIt end, counting_iterator it) return it + (end - begin); } -// A compile-time string which is compiled into fast formatting code. -class compiled_string {}; - template struct is_compiled_string : std::is_base_of {}; @@ -41,8 +42,7 @@ struct is_compiled_string : std::is_base_of {}; * std::string s = fmt::format(FMT_COMPILE("{}"), 42); */ #if defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction) -# define FMT_COMPILE(s) \ - FMT_STRING_IMPL(s, fmt::detail::compiled_string, explicit) +# define FMT_COMPILE(s) FMT_STRING_IMPL(s, fmt::compiled_string, explicit) #else # define FMT_COMPILE(s) FMT_STRING(s) #endif