From Jason Turner

[compare.type]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp5gnhpo61/{from.md → to.md} +32 -0
tmp/tmp5gnhpo61/{from.md → to.md} RENAMED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Type Ordering <a id="compare.type">[[compare.type]]</a>
2
+
3
+ There is an *implementation-defined* total ordering of all types. For
4
+ any (possibly incomplete) types `X` and `Y`, the expression
5
+ `TYPE-ORDER(X, Y)` is a constant expression [[expr.const]] of type
6
+ `strong_ordering` [[cmp.strongord]]. Its value is
7
+ `strong_ordering::less` if `X` precedes `Y` in this
8
+ implementation-defined total order, `strong_ordering::greater` if `Y`
9
+ precedes `X`, and `strong_ordering::equal` if they are the same type.
10
+
11
+ [*Note 1*: `int`, `const int` and `int&` are different
12
+ types. — *end note*]
13
+
14
+ [*Note 2*: This ordering need not be consistent with the one induced by
15
+ `type_info::before`. — *end note*]
16
+
17
+ [*Note 3*: The ordering of TU-local types from different translation
18
+ units is not observable, because the necessary specialization of
19
+ `type_order` is impossible to name. — *end note*]
20
+
21
+ ``` cpp
22
+ template<class T, class U>
23
+ struct type_order;
24
+ ```
25
+
26
+ The name `type_order` denotes a *Cpp17BinaryTypeTrait*[[meta.rqmts]]
27
+ with a base characteristic of
28
+ `integral_constant<strong_ordering, `*`TYPE-ORDER`*`(T, U)>`.
29
+
30
+ *Recommended practice:* The order should be lexicographical on
31
+ parameter-type-lists and template argument lists.
32
+