Skip to content

Commit 276ee5f

Browse files
authored
fix: update to_string_view function for fmt 11.1 (#3301)
Signed-off-by: Rui Chen <[email protected]>
1 parent 24dde31 commit 276ee5f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/spdlog/common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,17 @@ SPDLOG_CONSTEXPR_FUNC spdlog::wstring_view_t to_string_view(spdlog::wstring_view
365365
#endif
366366

367367
#ifndef SPDLOG_USE_STD_FORMAT
368+
#if FMT_VERSION >= 110100
369+
template <typename T, typename... Args>
370+
inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_arg<T> fmt) {
371+
return fmt;
372+
}
373+
#else
368374
template <typename T, typename... Args>
369375
inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_string<T, Args...> fmt) {
370376
return fmt;
371377
}
378+
#endif
372379
#elif __cpp_lib_format >= 202207L
373380
template <typename T, typename... Args>
374381
SPDLOG_CONSTEXPR_FUNC std::basic_string_view<T> to_string_view(

0 commit comments

Comments
 (0)