From e69699e12c64a7bedd635531711d61327b755a02 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 8 Jun 2020 00:38:30 +0300 Subject: [PATCH] enable_if --- include/spdlog/logger.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 64aad572..b2c9318a 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -74,8 +74,7 @@ public: void swap(spdlog::logger &other) SPDLOG_NOEXCEPT; // FormatString is a type derived from fmt::compile_string - template::value, int>::type * = nullptr, - typename... Args> + template::value, int>::type = 0, typename... Args> void log(source_loc loc, level::level_enum lvl, const FormatString &fmt, const Args &... args) { log_(loc, lvl, fmt, args...); @@ -137,9 +136,8 @@ public: } // T can be statically converted to string_view and isn't a fmt::compile_string - template::value && !fmt::is_compile_string::value, T>::type - * = nullptr> + template::value && !fmt::is_compile_string::value, int>::type = 0> void log(source_loc loc, level::level_enum lvl, const T &msg) { log(loc, lvl, string_view_t{msg}); @@ -179,7 +177,7 @@ public: // T cannot be statically converted to string_view or wstring_view template::value && !is_convertible_to_wstring_view::value, - T>::type * = nullptr> + int>::type = 0> void log(source_loc loc, level::level_enum lvl, const T &msg) { log(loc, lvl, "{}", msg); @@ -250,7 +248,7 @@ public: } // T can be statically converted to wstring_view - template::value, T>::type * = nullptr> + template::value, int>::type = 0> void log(source_loc loc, level::level_enum lvl, const T &msg) { bool log_enabled = should_log(lvl);