File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1120,7 +1120,7 @@ inline constexpr bool operator!=(const T& x, const uint<N>& y) noexcept
1120
1120
return uint <N>(x) != y;
1121
1121
}
1122
1122
1123
- #if !defined(_MSC_VER) || _MSC_VER < 1916 // This kills MSVC 2017 compiler.
1123
+ #if 0 && ( !defined(_MSC_VER) || _MSC_VER < 1916) // This kills MSVC 2017 compiler.
1124
1124
inline constexpr bool operator<(const uint256& x, const uint256& y) noexcept
1125
1125
{
1126
1126
auto xp = uint128{x[2], x[3]};
@@ -1137,7 +1137,11 @@ inline constexpr bool operator<(const uint256& x, const uint256& y) noexcept
1137
1137
template <unsigned N>
1138
1138
inline constexpr bool operator <(const uint <N>& x, const uint <N>& y) noexcept
1139
1139
{
1140
- return subc (x, y).carry ;
1140
+ for (size_t i = uint <N>::num_words; i-- > 1 ; ) {
1141
+ if (x[i] != y[i])
1142
+ return x[i] < y[i];
1143
+ }
1144
+ return x[0 ] < y[0 ];
1141
1145
}
1142
1146
1143
1147
template <unsigned N, typename T,
You can’t perform that action at this time.
0 commit comments