From 27cce3eca68e441fb27c87cada012a1eb773596e Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 23 May 2025 00:49:47 -0500 Subject: [PATCH] [ox/std] Fix implementation of std cmp functions --- deps/ox/src/ox/std/utility.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deps/ox/src/ox/std/utility.hpp b/deps/ox/src/ox/std/utility.hpp index f1e55301..fbb455d4 100644 --- a/deps/ox/src/ox/std/utility.hpp +++ b/deps/ox/src/ox/std/utility.hpp @@ -32,9 +32,9 @@ constexpr bool cmp_equal(T const t, U const u) noexcept { if constexpr(ox::is_signed_v == ox::is_signed_v) { return t == u; } else if constexpr(ox::is_signed_v) { - return ox::Signed{t} == u; + return t >= 0 && static_cast>(t) == u; } else { - return t == ox::Signed{u}; + return u >= 0 && t == static_cast>(u); } } @@ -43,9 +43,9 @@ constexpr bool cmp_less(T const t, U const u) noexcept { if constexpr(ox::is_signed_v == ox::is_signed_v) { return t < u; } else if constexpr(ox::is_signed_v) { - return ox::Signed{t} < u; + return t >= 0 && static_cast>(t) < u; } else { - return t < ox::Signed{u}; + return u >= 0 && t < static_cast>(u); } }