From 2f255a528e61a40bdea31499cf0d78f19e8ea66b Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 20 Feb 2020 15:00:22 +0300 Subject: [PATCH] Another attempt on umax --- Utilities/types.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Utilities/types.h b/Utilities/types.h index f6d3a0a876..5f48a340ef 100644 --- a/Utilities/types.h +++ b/Utilities/types.h @@ -414,39 +414,39 @@ constexpr inline struct umax_helper { constexpr umax_helper() noexcept = default; - template >, typename = std::enable_if_t>> + template , typename = std::enable_if_t>> explicit constexpr operator T() const { return std::numeric_limits::max(); } - template >, typename = std::enable_if_t>> + template , typename = std::enable_if_t>> constexpr bool operator==(const T& rhs) const { - return rhs == std::numeric_limits>>::max(); + return std::numeric_limits::max() == rhs; } #if __cpp_impl_three_way_comparison >= 201711 && !__INTELLISENSE__ #else template - friend constexpr std::enable_if_t>>, bool> operator==(const T& lhs, const umax_helper& rhs) + friend constexpr std::enable_if_t>, bool> operator==(const T& lhs, const umax_helper& rhs) { - return rhs == lhs; + return std::numeric_limits>::max() == lhs; } #endif #if __cpp_impl_three_way_comparison >= 201711 #else - template >, typename = std::enable_if_t>> + template , typename = std::enable_if_t>> constexpr bool operator!=(const T& rhs) const { - return rhs != std::numeric_limits>>::max(); + return std::numeric_limits::max() != rhs; } template - friend constexpr std::enable_if_t>>, bool> operator!=(const T& lhs, const umax_helper& rhs) + friend constexpr std::enable_if_t>, bool> operator!=(const T& lhs, const umax_helper& rhs) { - return rhs != lhs; + return std::numeric_limits>::max() != lhs; } #endif } umax;