[ox/std] Fix implementation of std cmp functions
All checks were successful
Build / build (push) Successful in 1m13s
All checks were successful
Build / build (push) Successful in 1m13s
This commit is contained in:
parent
a40198ab8d
commit
27cce3eca6
8
deps/ox/src/ox/std/utility.hpp
vendored
8
deps/ox/src/ox/std/utility.hpp
vendored
@ -32,9 +32,9 @@ constexpr bool cmp_equal(T const t, U const u) noexcept {
|
||||
if constexpr(ox::is_signed_v<T> == ox::is_signed_v<U>) {
|
||||
return t == u;
|
||||
} else if constexpr(ox::is_signed_v<T>) {
|
||||
return ox::Signed<T>{t} == u;
|
||||
return t >= 0 && static_cast<ox::Unsigned<T>>(t) == u;
|
||||
} else {
|
||||
return t == ox::Signed<U>{u};
|
||||
return u >= 0 && t == static_cast<ox::Unsigned<U>>(u);
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,9 +43,9 @@ constexpr bool cmp_less(T const t, U const u) noexcept {
|
||||
if constexpr(ox::is_signed_v<T> == ox::is_signed_v<U>) {
|
||||
return t < u;
|
||||
} else if constexpr(ox::is_signed_v<T>) {
|
||||
return ox::Signed<T>{t} < u;
|
||||
return t >= 0 && static_cast<ox::Unsigned<T>>(t) < u;
|
||||
} else {
|
||||
return t < ox::Signed<U>{u};
|
||||
return u >= 0 && t < static_cast<ox::Unsigned<U>>(u);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user