Merge pull request #2013 from gabime/pr-2011

Fix ambiguous error in clang13 and c++20
This commit is contained in:
Gabi Melman 2021-07-27 01:12:48 +03:00 committed by GitHub
commit 536e583cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,6 +102,15 @@ public:
log(loc, lvl, string_view_t{msg});
}
// T cannot be statically converted to niether string_view, neither wstring_view and niether to format string
template<class T, typename std::enable_if<!std::is_convertible<const T &, spdlog::string_view_t>::value
&& !is_convertible_to_basic_format_string<const T&>::value,
int>::type = 0>
void log(source_loc loc, level::level_enum lvl, const T &msg)
{
log(loc, lvl, "{}", msg);
}
void log(log_clock::time_point log_time, source_loc loc, level::level_enum lvl, string_view_t msg)
{
bool log_enabled = should_log(lvl);
@ -132,14 +141,7 @@ public:
{
log(source_loc{}, lvl, msg);
}
// T cannot be statically converted to string_view or wstring_view
template<class T, typename std::enable_if<!is_convertible_to_basic_format_string<T>::value, int>::type = 0>
void log(source_loc loc, level::level_enum lvl, const T &msg)
{
log(loc, lvl, "{}", msg);
}
template<typename... Args>
void trace(fmt::format_string<Args...> fmt, Args &&...args)
{