From 1afd6fbe065f57c306ee66fd58a175d0fff721dd Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 16 Mar 2021 11:30:18 +0200 Subject: [PATCH] hashing: appending_hash: convert from enable_if to concepts A little simpler to understand. Closes #8288 --- hashing.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hashing.hh b/hashing.hh index 57d29074d7..c6623d17f5 100644 --- a/hashing.hh +++ b/hashing.hh @@ -56,7 +56,7 @@ public: static_assert(Hasher); -template +template struct appending_hash; template @@ -67,7 +67,8 @@ void feed_hash(H& h, const T& value, Args&&... args) noexcept { }; template -struct appending_hash::value>> { +requires std::is_arithmetic_v +struct appending_hash { template requires Hasher void operator()(H& h, T value) const noexcept { @@ -86,7 +87,8 @@ struct appending_hash { }; template -struct appending_hash::value>> { +requires std::is_enum_v +struct appending_hash { template requires Hasher void operator()(H& h, const T& value) const noexcept {