Skip to content

Commit

Permalink
src: simplify enable_if logic of ToStringHelper::BaseConvert
Browse files Browse the repository at this point in the history
PR-URL: #44306
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
F3n67u authored and RafaelGSS committed Sep 6, 2022
1 parent fbb8503 commit 5eb9949
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/debug_utils-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct ToStringHelper {
static std::string Convert(bool value) { return value ? "true" : "false"; }
template <unsigned BASE_BITS,
typename T,
typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
typename = std::enable_if_t<std::is_integral_v<T>>>
static std::string BaseConvert(const T& value) {
auto v = static_cast<uint64_t>(value);
char ret[3 * sizeof(T)];
Expand All @@ -45,7 +45,7 @@ struct ToStringHelper {
}
template <unsigned BASE_BITS,
typename T,
typename std::enable_if<!std::is_integral<T>::value, int>::type = 0>
typename = std::enable_if_t<!std::is_integral_v<T>>>
static std::string BaseConvert(T value) {
return Convert(std::forward<T>(value));
}
Expand Down

0 comments on commit 5eb9949

Please sign in to comment.