From Jason Turner

[compare.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpufj99fu5/{from.md → to.md} +56 -0
tmp/tmpufj99fu5/{from.md → to.md} RENAMED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Header `<compare>` synopsis <a id="compare.syn">[[compare.syn]]</a>
2
+
3
+ The header `<compare>` specifies types, objects, and functions for use
4
+ primarily in connection with the three-way comparison operator
5
+ [[expr.spaceship]].
6
+
7
+ ``` cpp
8
+ namespace std {
9
+ // [cmp.categories], comparison category types
10
+ class partial_ordering;
11
+ class weak_ordering;
12
+ class strong_ordering;
13
+
14
+ // named comparison functions
15
+ constexpr bool is_eq (partial_ordering cmp) noexcept { return cmp == 0; }
16
+ constexpr bool is_neq (partial_ordering cmp) noexcept { return cmp != 0; }
17
+ constexpr bool is_lt (partial_ordering cmp) noexcept { return cmp < 0; }
18
+ constexpr bool is_lteq(partial_ordering cmp) noexcept { return cmp <= 0; }
19
+ constexpr bool is_gt (partial_ordering cmp) noexcept { return cmp > 0; }
20
+ constexpr bool is_gteq(partial_ordering cmp) noexcept { return cmp >= 0; }
21
+
22
+ // [cmp.common], common comparison category type
23
+ template<class... Ts>
24
+ struct common_comparison_category {
25
+ using type = see below;
26
+ };
27
+ template<class... Ts>
28
+ using common_comparison_category_t = typename common_comparison_category<Ts...>::type;
29
+
30
+ // [cmp.concept], concept three_way_comparable
31
+ template<class T, class Cat = partial_ordering>
32
+ concept three_way_comparable = see below;
33
+ template<class T, class U, class Cat = partial_ordering>
34
+ concept three_way_comparable_with = see below;
35
+
36
+ // [cmp.result], result of three-way comparison
37
+ template<class T, class U = T> struct compare_three_way_result;
38
+
39
+ template<class T, class U = T>
40
+ using compare_three_way_result_t = typename compare_three_way_result<T, U>::type;
41
+
42
+ // [comparisons.three.way], class compare_three_way
43
+ struct compare_three_way;
44
+
45
+ // [cmp.alg], comparison algorithms
46
+ inline namespace unspecified {
47
+ inline constexpr unspecified strong_order = unspecified;
48
+ inline constexpr unspecified weak_order = unspecified;
49
+ inline constexpr unspecified partial_order = unspecified;
50
+ inline constexpr unspecified compare_strong_order_fallback = unspecified;
51
+ inline constexpr unspecified compare_weak_order_fallback = unspecified;
52
+ inline constexpr unspecified compare_partial_order_fallback = unspecified;
53
+ }
54
+ }
55
+ ```
56
+