diff --git a/src/debug_utils-inl.h b/src/debug_utils-inl.h index c10af8b1b618bc..db59efaf112ef7 100644 --- a/src/debug_utils-inl.h +++ b/src/debug_utils-inl.h @@ -38,9 +38,11 @@ struct ToStringHelper { template ::value, bool>::type, + enable_if_t || std::is_enum_v, bool>, typename dummy = bool> - static std::string Convert(const T& value) { return std::to_string(value); } + static std::string Convert(const T& value) { + return std::to_string(value); + } static std::string_view Convert(const char* value) { return value != nullptr ? value : "(null)"; } @@ -58,8 +60,7 @@ struct ToStringHelper { const char* digits = "0123456789abcdef"; do { unsigned digit = v & ((1 << BASE_BITS) - 1); - *--ptr = - (BASE_BITS < 4 ? static_cast('0' + digit) : digits[digit]); + *--ptr = (BASE_BITS < 4 ? static_cast('0' + digit) : digits[digit]); } while ((v >>= BASE_BITS) != 0); return ptr; } @@ -139,12 +140,10 @@ std::string COLD_NOINLINE SPrintFImpl( // NOLINT(runtime/string) ret += node::ToUpper(ToBaseString<4>(arg)); break; case 'p': { - CHECK(std::is_pointer::type>::value); + CHECK(std::is_pointer_v>); char out[20]; - int n = snprintf(out, - sizeof(out), - "%p", - *reinterpret_cast(&arg)); + int n = snprintf( + out, sizeof(out), "%p", *reinterpret_cast(&arg)); CHECK_GE(n, 0); ret += out; break;