From 276ee5f5c0eb13626bd367b006ace5eae9526d8a Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Thu, 26 Dec 2024 02:13:57 -0500 Subject: [PATCH] fix: update to_string_view function for fmt 11.1 (#3301) Signed-off-by: Rui Chen --- include/spdlog/common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index aca483c2..2d73f830 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -365,10 +365,17 @@ SPDLOG_CONSTEXPR_FUNC spdlog::wstring_view_t to_string_view(spdlog::wstring_view #endif #ifndef SPDLOG_USE_STD_FORMAT +#if FMT_VERSION >= 110100 +template +inline fmt::basic_string_view to_string_view(fmt::basic_format_arg fmt) { + return fmt; +} +#else template inline fmt::basic_string_view to_string_view(fmt::basic_format_string fmt) { return fmt; } +#endif #elif __cpp_lib_format >= 202207L template SPDLOG_CONSTEXPR_FUNC std::basic_string_view to_string_view(