Home
last modified time | relevance | path

Searched refs:weak_ordering (Results 1 – 25 of 32) sorted by relevance

12

/llvm-project-15.0.7/libcxx/test/std/language.support/cmp/cmp.alg/
H A Dweak_order.pass.cpp75 explicit operator std::weak_ordering() const { return std::weak_ordering::less; } in operator std::weak_ordering()
100 assert(std::weak_order(c1, c2) == std::weak_ordering::less); in test_1_2()
149 assert(std::weak_order(v[0], v[1]) == std::weak_ordering::less); in test_1_3()
395 constexpr std::weak_ordering operator<=>(A&, A&&) { return std::weak_ordering::less; } in operator <=>()
396 constexpr std::weak_ordering operator<=>(A&&, A&&) { return std::weak_ordering::equivalent; } in operator <=>()
397 std::weak_ordering operator<=>(const A&, const A&);
410 return std::weak_ordering::equivalent; in operator <=>()
447 friend std::weak_ordering strong_order(B&, B&);
451 operator std::weak_ordering() const { return std::weak_ordering::less; } in operator std::weak_ordering()
459 operator std::weak_ordering() const = delete;
[all …]
H A Dcompare_weak_order_fallback.pass.cpp75 explicit operator std::weak_ordering() const { return std::weak_ordering::less; } in operator std::weak_ordering()
100 assert(std::compare_weak_order_fallback(c1, c2) == std::weak_ordering::less); in test_1_2()
395 constexpr std::weak_ordering operator<=>(A&, A&&) { return std::weak_ordering::less; } in operator <=>()
396 constexpr std::weak_ordering operator<=>(A&&, A&&) { return std::weak_ordering::equivalent; } in operator <=>()
397 std::weak_ordering operator<=>(const A&, const A&);
401 std::weak_ordering operator<=>(const B&) const; // lacks operator==
408 constexpr std::weak_ordering operator<=>(const C& rhs) const { in operator <=>()
410 return std::weak_ordering::equivalent; in operator <=>()
447 friend std::weak_ordering strong_order(B&, B&);
451 operator std::weak_ordering() const { return std::weak_ordering::less; } in operator std::weak_ordering()
[all …]
H A Dpartial_order.pass.cpp67 std::weak_ordering partial_order(A&&, A&&) { return std::weak_ordering::equivalent; } in partial_order()
205 constexpr explicit operator std::weak_ordering() const { return std::weak_ordering::less; } in operator std::weak_ordering()
H A Dcompare_partial_order_fallback.pass.cpp67 std::weak_ordering partial_order(A&&, A&&) { return std::weak_ordering::equivalent; } in partial_order()
205 constexpr explicit operator std::weak_ordering() const { return std::weak_ordering::less; } in operator std::weak_ordering()
/llvm-project-15.0.7/libcxx/test/std/language.support/cmp/cmp.weakord/
H A Dweakord.pass.cpp25 DoNotOptimize(&std::weak_ordering::less); in test_static_members()
62 auto V = std::weak_ordering::less; in test_conversion()
87 auto& Less = std::weak_ordering::less; in test_constexpr()
90 std::weak_ordering Value; in test_constexpr()
130 std::weak_ordering Value; in test_constexpr()
155 static_assert(std::weak_ordering::less == std::weak_ordering::less); in test_constexpr()
156 static_assert(std::weak_ordering::less != std::weak_ordering::equivalent); in test_constexpr()
157 static_assert(std::weak_ordering::less != std::weak_ordering::greater); in test_constexpr()
159 static_assert(std::weak_ordering::equivalent != std::weak_ordering::less); in test_constexpr()
165 static_assert(std::weak_ordering::greater != std::weak_ordering::less); in test_constexpr()
[all …]
/llvm-project-15.0.7/clang/test/SemaCXX/Inputs/
H A Dstd-compare.h119 class weak_ordering {
125 static const weak_ordering less;
149 friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
150 friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
161 inline constexpr weak_ordering weak_ordering::less(_OrdResult::__less);
162 inline constexpr weak_ordering weak_ordering::equivalent(_EqResult::__equiv);
163 inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater);
201 constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
204 constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
205 return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
[all …]
/llvm-project-15.0.7/clang/test/PCH/Inputs/
H A Dstd-compare.h119 class weak_ordering {
125 static const weak_ordering less;
149 friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
150 friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
161 inline constexpr weak_ordering weak_ordering::less(_OrdResult::__less);
162 inline constexpr weak_ordering weak_ordering::equivalent(_EqResult::__equiv);
163 inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater);
201 constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
204 constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
205 return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
[all …]
/llvm-project-15.0.7/clang/test/CodeGenCXX/Inputs/
H A Dstd-compare.h119 class weak_ordering {
125 static const weak_ordering less;
149 friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
150 friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
161 inline constexpr weak_ordering weak_ordering::less(_OrdResult::__less);
162 inline constexpr weak_ordering weak_ordering::equivalent(_EqResult::__equiv);
163 inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater);
201 constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
204 constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
205 return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
[all …]
/llvm-project-15.0.7/libcxx/include/__compare/
H A Dordering.h35 class weak_ordering; variable
138 class weak_ordering {
145 static const weak_ordering less;
157 friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default;
205 friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
210 friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
211 return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
218 inline constexpr weak_ordering weak_ordering::less(_OrdResult::__less);
219 inline constexpr weak_ordering weak_ordering::equivalent(_OrdResult::__equiv);
220 inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater);
[all …]
H A Dweak_order.h36 … noexcept(noexcept(weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
37 … -> decltype( weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
38 … { return weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
42 _LIBCPP_HIDE_FROM_ABI static constexpr weak_ordering
47 return weak_ordering::less; in __go()
49 return weak_ordering::equivalent; in __go()
51 return weak_ordering::greater; in __go()
61 return __t_is_negative ? weak_ordering::less : weak_ordering::greater; in __go()
63 return __u_is_negative ? weak_ordering::greater : weak_ordering::less; in __go()
73 …-> decltype( weak_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(…
[all …]
H A Dcompare_weak_order_fallback.h42 …noexcept(noexcept(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? weak_ordering::equivalent…
43 … _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? weak_ordering::less :
44 weak_ordering::greater))
45 …-> decltype( _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? weak_ordering::equivalent…
46 … _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? weak_ordering::less :
47 weak_ordering::greater)
49 …return _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? weak_ordering::equivalent…
50 … _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? weak_ordering::less :
51 weak_ordering::greater;
H A Dsynth_three_way.h38 if (__t < __u) return weak_ordering::less;
39 if (__u < __t) return weak_ordering::greater;
40 return weak_ordering::equivalent;
H A Dcommon_comparison_category.h39 if (is_same_v<_Tp, weak_ordering>) in __type_to_enum()
73 return weak_ordering::equivalent; in __get_comp_type()
/llvm-project-15.0.7/libcxx/test/std/language.support/cmp/compare.syn/
H A Dnamed_functions.pass.cpp30 assert(!std::is_eq(std::weak_ordering::less)); in test()
31 assert( std::is_eq(std::weak_ordering::equivalent)); in test()
32 assert(!std::is_eq(std::weak_ordering::greater)); in test()
41 assert( std::is_neq(std::weak_ordering::less)); in test()
43 assert( std::is_neq(std::weak_ordering::greater)); in test()
52 assert( std::is_lt(std::weak_ordering::less)); in test()
54 assert(!std::is_lt(std::weak_ordering::greater)); in test()
63 assert( std::is_lteq(std::weak_ordering::less)); in test()
74 assert(!std::is_gt(std::weak_ordering::less)); in test()
76 assert( std::is_gt(std::weak_ordering::greater)); in test()
[all …]
/llvm-project-15.0.7/libcxx/test/std/library/description/conventions/expos.only.func/
H A Dsynth_three_way.pass.cpp78 constexpr std::weak_ordering operator<=>(const WeakSpaceship& other) const { in test()
83 assert(synth_three_way(WeakSpaceship{2}, WeakSpaceship{1}) == std::weak_ordering::greater); in test()
84 assert(synth_three_way(WeakSpaceship{1}, WeakSpaceship{2}) == std::weak_ordering::less); in test()
85 ASSERT_SAME_TYPE(std::weak_ordering, synth_three_way_result<WeakSpaceship, WeakSpaceship>); in test()
108 assert(synth_three_way(NoSpaceship{1}, NoSpaceship{1}) == std::weak_ordering::equivalent); in test()
109 assert(synth_three_way(NoSpaceship{2}, NoSpaceship{1}) == std::weak_ordering::greater); in test()
110 assert(synth_three_way(NoSpaceship{1}, NoSpaceship{2}) == std::weak_ordering::less); in test()
111 ASSERT_SAME_TYPE(std::weak_ordering, synth_three_way_result<NoSpaceship, NoSpaceship>); in test()
154 assert(synth_three_way(1, 1U) == std::weak_ordering::equivalent); in test()
155 assert(synth_three_way(-1, 0U) == std::weak_ordering::greater); in test()
[all …]
/llvm-project-15.0.7/clang/test/CXX/class/class.compare/class.spaceship/
H A Dp2.cpp14 class weak_ordering { class
16 constexpr weak_ordering(int n) : n(n) {} in weak_ordering() function in std::weak_ordering
18 constexpr weak_ordering(strong_ordering o);
19 static const weak_ordering less, equivalent, greater;
22 constexpr weak_ordering weak_ordering::less{-1},
23 weak_ordering::equivalent{0}, weak_ordering::greater{1};
30 constexpr partial_ordering(weak_ordering o);
69 friend std::weak_ordering operator<=>(weak, weak);
87 template void f<std::weak_ordering, weak>();
88 template void f<std::weak_ordering, weak, strong>();
[all …]
H A Dp1.cpp12 struct weak_ordering { struct
14 constexpr weak_ordering(int n) : n(n) {} in weak_ordering() function
15 constexpr weak_ordering(strong_ordering o) : n(o.n) {} in weak_ordering() argument
17 static const weak_ordering less, equivalent, greater; argument
19 constexpr weak_ordering weak_ordering::less{-1},
20 weak_ordering::equivalent{0}, weak_ordering::greater{1};
26 constexpr partial_ordering(weak_ordering o) : d(o.n) {} in partial_ordering()
194 static_assert(cmp<std::weak_ordering>(True) == 0);
195 static_assert(cmp<std::weak_ordering>(False, True) < 0);
196 static_assert(cmp<std::weak_ordering>(False, False) > 0);
/llvm-project-15.0.7/libcxx/include/
H A Dcompare19 class weak_ordering;
87 // [cmp.weakord], Class weak_ordering
88 class weak_ordering {
91 static const weak_ordering less;
92 static const weak_ordering equivalent;
93 static const weak_ordering greater;
99 friend constexpr bool operator==(weak_ordering v, unspecified) noexcept;
100 friend constexpr bool operator==(weak_ordering v, weak_ordering w) noexcept = default;
109 friend constexpr weak_ordering operator<=>(weak_ordering v, unspecified) noexcept;
110 friend constexpr weak_ordering operator<=>(unspecified, weak_ordering v) noexcept;
[all …]
/llvm-project-15.0.7/libcxx/test/std/language.support/cmp/cmp.result/
H A Dcompare_three_way_result.compile.pass.cpp75 std::weak_ordering operator<=>(const D&) const&; // comparison is always done by const&
78 ASSERT_SAME_TYPE(std::compare_three_way_result_t<D>, std::weak_ordering);
79 ASSERT_SAME_TYPE(std::compare_three_way_result_t<D&>, std::weak_ordering);
80 ASSERT_SAME_TYPE(std::compare_three_way_result_t<D&&>, std::weak_ordering);
81 ASSERT_SAME_TYPE(std::compare_three_way_result_t<const D&>, std::weak_ordering);
82 ASSERT_SAME_TYPE(std::compare_three_way_result_t<const D&&>, std::weak_ordering);
84 ASSERT_SAME_TYPE(std::compare_three_way_result_t<D, D>, std::weak_ordering);
85 ASSERT_SAME_TYPE(std::compare_three_way_result_t<D&, D&>, std::weak_ordering);
86 ASSERT_SAME_TYPE(std::compare_three_way_result_t<D&&, D&&>, std::weak_ordering);
87 ASSERT_SAME_TYPE(std::compare_three_way_result_t<const D&, const D&>, std::weak_ordering);
[all …]
/llvm-project-15.0.7/libcxx/test/std/language.support/cmp/cmp.concept/
H A Dthree_way_comparable.compile.pass.cpp45 static_assert(std::three_way_comparable<int, std::weak_ordering>);
47 static_assert(!std::three_way_comparable<double, std::weak_ordering>);
49 static_assert(std::three_way_comparable<void*, std::weak_ordering>);
51 static_assert(std::three_way_comparable<char*, std::weak_ordering>);
53 static_assert(std::three_way_comparable<char const*, std::weak_ordering>);
55 static_assert(std::three_way_comparable<char volatile*, std::weak_ordering>);
57 static_assert(std::three_way_comparable<char const volatile*, std::weak_ordering>);
59 static_assert(std::three_way_comparable<wchar_t&, std::weak_ordering>);
61 static_assert(std::three_way_comparable<char8_t const&, std::weak_ordering>);
63 static_assert(std::three_way_comparable<char16_t volatile&, std::weak_ordering>);
[all …]
H A Dthree_way_comparable_with.compile.pass.cpp56 static_assert(check_three_way_comparable_with<int, int, std::weak_ordering>());
57 static_assert(check_three_way_comparable_with<int, char, std::weak_ordering>());
58 static_assert(!check_three_way_comparable_with<int, unsigned int, std::weak_ordering>());
121 static_assert(check_three_way_comparable_with<S, int, std::weak_ordering>());
/llvm-project-15.0.7/libcxx/test/std/utilities/function.objects/comparisons/
H A Dcompare_three_way.pass.cpp39 …friend constexpr std::weak_ordering operator<=>(const WeaklyOrdered&, const WeaklyOrdered&) = defa…
49 …E_TYPE(decltype(std::compare_three_way()(WeaklyOrdered{1}, WeaklyOrdered{2})), std::weak_ordering); in test()
50 … assert(std::compare_three_way()(WeaklyOrdered{1}, WeaklyOrdered{2}) == std::weak_ordering::less); in test()
51 …assert(std::compare_three_way()(WeaklyOrdered{1}, WeaklyOrdered{1}) == std::weak_ordering::equival… in test()
52 …assert(std::compare_three_way()(WeaklyOrdered{2}, WeaklyOrdered{1}) == std::weak_ordering::greater… in test()
/llvm-project-15.0.7/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.rel/
H A Dthree_way.pass.cpp140 …constexpr std::weak_ordering operator<=>(const WeakSpaceship&) const { return std::weak_ordering::… in test()
146 ASSERT_SAME_TYPE(decltype(T1() <=> T2()), std::weak_ordering); in test()
164 ASSERT_SAME_TYPE(decltype(T1() <=> T2()), std::weak_ordering); in test()
174 ASSERT_SAME_TYPE(decltype(T1() <=> T2()), std::weak_ordering); in test()
185 ASSERT_SAME_TYPE(decltype(T1() <=> T2()), std::weak_ordering); in test()
186 ASSERT_SAME_TYPE(decltype(T3() <=> T3()), std::weak_ordering); in test()
193 ASSERT_SAME_TYPE(decltype(T1() <=> T2()), std::weak_ordering); in test()
/llvm-project-15.0.7/libcxx/test/std/language.support/cmp/cmp.strongord/
H A Dstrongord.pass.cpp60 auto& WeakEq = std::weak_ordering::equivalent; in test_equality()
85 std::weak_ordering>::value, ""); in test_conversion()
88 std::weak_ordering WV = V; in test_conversion()
93 std::weak_ordering WV = V; in test_conversion()
98 std::weak_ordering WV = V; in test_conversion()
/llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/
H A Dthree_way_comparison.pass.cpp46 ASSERT_SAME_TYPE(decltype(P() <=> P()), std::weak_ordering); in test()
47 assert((P(1, {1}) <=> P(1, {2})) == std::weak_ordering::less); in test()
48 assert((P(2, {1}) <=> P(1, {2})) == std::weak_ordering::greater); in test()
49 assert((P(0, {0}) <=> P(0, {0})) == std::weak_ordering::equivalent); in test()

12