From a6229d9e87ec40b2536b0f4a71c671fbb9090048 Mon Sep 17 00:00:00 2001 From: DanielChabrowski Date: Wed, 6 Feb 2019 05:24:25 +0100 Subject: [PATCH] Remove pointless log with enable_if --- include/spdlog/details/logger_impl.h | 18 ++++++------------ include/spdlog/logger.h | 7 +------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index 0212ede5..d44652b5 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -102,6 +102,12 @@ inline void spdlog::logger::log(level::level_enum lvl, const char *msg) log(source_loc{}, lvl, msg); } +template +inline void spdlog::logger::log(level::level_enum lvl, const T &msg) +{ + log(source_loc{}, lvl, msg); +} + template::value, T>::type *> inline void spdlog::logger::log(source_loc source, level::level_enum lvl, const T &msg) { @@ -117,12 +123,6 @@ inline void spdlog::logger::log(source_loc source, level::level_enum lvl, const SPDLOG_CATCH_AND_HANDLE } -template::value, T>::type *> -inline void spdlog::logger::log(level::level_enum lvl, const T &msg) -{ - log(source_loc{}, lvl, msg); -} - template::value, T>::type *> inline void spdlog::logger::log(source_loc source, level::level_enum lvl, const T &msg) { @@ -141,12 +141,6 @@ inline void spdlog::logger::log(source_loc source, level::level_enum lvl, const SPDLOG_CATCH_AND_HANDLE } -template::value, T>::type *> -inline void spdlog::logger::log(level::level_enum lvl, const T &msg) -{ - log(source_loc{}, lvl, msg); -} - template inline void spdlog::logger::trace(const char *fmt, const Args &... args) { diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 3dbaaa64..ec06828f 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -100,18 +100,13 @@ public: #endif // _WIN32 #endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT - // T can be statically converted to string_view - template::value, T>::type * = nullptr> + template void log(level::level_enum lvl, const T &); // T can be statically converted to string_view template::value, T>::type * = nullptr> void log(source_loc loc, level::level_enum lvl, const T &); - // T cannot be statically converted to string_view - template::value, T>::type * = nullptr> - void log(level::level_enum lvl, const T &); - // T cannot be statically converted to string_view template::value, T>::type * = nullptr> void log(source_loc loc, level::level_enum lvl, const T &);