From 8426148169997ad10f84474fc16e795d7ac770e7 Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Sat, 20 Aug 2022 21:54:58 +0800 Subject: [PATCH] src: simplify enable_if logic of `ToStringHelper::BaseConvert` --- src/debug_utils-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug_utils-inl.h b/src/debug_utils-inl.h index d87dd62c8952af..0fb760834d5792 100644 --- a/src/debug_utils-inl.h +++ b/src/debug_utils-inl.h @@ -29,7 +29,7 @@ struct ToStringHelper { static std::string Convert(bool value) { return value ? "true" : "false"; } template ::value, int>::type = 0> + typename = std::enable_if_t>> static std::string BaseConvert(const T& value) { auto v = static_cast(value); char ret[3 * sizeof(T)]; @@ -45,7 +45,7 @@ struct ToStringHelper { } template ::value, int>::type = 0> + typename = std::enable_if_t>> static std::string BaseConvert(T value) { return Convert(std::forward(value)); }