Skip to content

Commit 1e345fb

Browse files
committed
passing all tests
1 parent 462fc50 commit 1e345fb

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

stl/inc/utility

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ _NODISCARD constexpr bool cmp_greater_equal(const _Ty1 _Left, const _Ty2 _Right)
695695
return !_STD cmp_less(_Left, _Right);
696696
}
697697

698+
#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
698699
// STRUCT TEMPLATE _Synth_three_way
699700
template <class _Ty = void>
700701
struct _Synth_three_way {
@@ -744,6 +745,7 @@ struct _Synth_three_way<void> {
744745
// ALIAS TEMPLATE _Synth_three_way_result
745746
template <class _Ty1, class _Ty2 = _Ty1>
746747
using _Synth_three_way_result = decltype(_Synth_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()));
748+
#endif // defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_concepts)
747749

748750
// FUNCTION TEMPLATE in_range
749751
template <class _Ty>

tests/std/tests/P0896R4_P1614R2_spaceship/test.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,23 @@ void unordered_containers_test(Container something, Container something_equal, C
4444
}
4545

4646
void ordering_test_cases() {
47-
// {
48-
// // array
49-
// std::array<int, 3> a1 = {100, 100, 100};
50-
// std::array<int, 3> a2 = {100, 100, 100};
51-
// std::array<int, 3> b1 = {200, 200};
52-
// ordered_containers_test(a1, a2, b1);
53-
// }
47+
{ // constexpr array
48+
constexpr std::array<int, 5> a0{{2, 8, 9, 1, 9}};
49+
constexpr std::array<int, 3> a1{{2, 8, 9}};
50+
constexpr std::array<int, 5> a2{{2, 8, 9, 1, 8}};
51+
52+
assert((a0 <=> a0) == 0);
53+
assert((a1 <=> a1) == 0);
54+
assert((a2 <=> a0) < 0);
55+
assert((a0 <=> a2) > 0);
56+
}
57+
{
58+
// array
59+
std::array<int, 3> a1 = {100, 100, 100};
60+
std::array<int, 3> a2 = {100, 100, 100};
61+
std::array<int, 3> b1 = {200, 200};
62+
ordered_containers_test(a1, a2, b1);
63+
}
5464
{ // deque
5565
std::deque<int> a1(3, 100);
5666
std::deque<int> a2(3, 100);

tests/std/tests/P1023R0_constexpr_for_array_comparisons/test.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ constexpr array<int, 3> a1{{2, 8, 9}};
1111
constexpr array<int, 5> a2{{2, 8, 9, 1, 8}};
1212
constexpr array<int, 0> a3{};
1313

14-
constexpr void test_operator_spaceship() {
15-
assert((a0 <=> a0) == 0);
16-
assert((a1 <=> a1) == 0);
17-
assert((a2 <=> a0) < 0);
18-
assert((a0 <=> a2) > 0);
19-
}
20-
2114
constexpr void test_operator_eq() {
2215
assert(a0 == a0);
2316
assert(a1 == a1);
@@ -63,7 +56,6 @@ constexpr void test_operator_geq() {
6356
}
6457

6558
constexpr bool test() {
66-
test_operator_spaceship();
6759
test_operator_eq();
6860
test_operator_neq();
6961
test_operator_lt();

0 commit comments

Comments
 (0)