Skip to content

Commit

Permalink
fix: update to_string_view function for fmt 11.1
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <rui@chenrui.dev>
  • Loading branch information
chenrui333 committed Dec 26, 2024
1 parent 24dde31 commit e693420
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/spdlog/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T, typename... Args>
inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_arg<T> fmt) {
return fmt;
}
#else
template <typename T, typename... Args>
inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_string<T, Args...> fmt) {
return fmt;
}
#endif
#elif __cpp_lib_format >= 202207L
template <typename T, typename... Args>
SPDLOG_CONSTEXPR_FUNC std::basic_string_view<T> to_string_view(
Expand Down

0 comments on commit e693420

Please sign in to comment.