From Jason Turner

[thread.thread.id]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9bm5n8ii/{from.md → to.md} +16 -43
tmp/tmp9bm5n8ii/{from.md → to.md} RENAMED
@@ -6,103 +6,76 @@ namespace std {
6
  public:
7
  id() noexcept;
8
  };
9
 
10
  bool operator==(thread::id x, thread::id y) noexcept;
11
- bool operator!=(thread::id x, thread::id y) noexcept;
12
- bool operator<(thread::id x, thread::id y) noexcept;
13
- bool operator<=(thread::id x, thread::id y) noexcept;
14
- bool operator>(thread::id x, thread::id y) noexcept;
15
- bool operator>=(thread::id x, thread::id y) noexcept;
16
 
17
  template<class charT, class traits>
18
  basic_ostream<charT, traits>&
19
  operator<<(basic_ostream<charT, traits>& out, thread::id id);
20
 
21
- // Hash support
22
  template<class T> struct hash;
23
  template<> struct hash<thread::id>;
24
  }
25
  ```
26
 
27
  An object of type `thread::id` provides a unique identifier for each
28
  thread of execution and a single distinct value for all `thread` objects
29
- that do not represent a thread of execution ([[thread.thread.class]]).
30
  Each thread of execution has an associated `thread::id` object that is
31
  not equal to the `thread::id` object of any other thread of execution
32
  and that is not equal to the `thread::id` object of any `thread` object
33
  that does not represent threads of execution.
34
 
35
- `thread::id` shall be a trivially copyable class (Clause  [[class]]).
36
- The library may reuse the value of a `thread::id` of a terminated thread
37
- that can no longer be joined.
38
 
39
  [*Note 1*: Relational operators allow `thread::id` objects to be used
40
  as keys in associative containers. — *end note*]
41
 
42
  ``` cpp
43
  id() noexcept;
44
  ```
45
 
46
- *Effects:* Constructs an object of type `id`.
47
-
48
- *Postconditions:* The constructed object does not represent a thread of
49
  execution.
50
 
51
  ``` cpp
52
  bool operator==(thread::id x, thread::id y) noexcept;
53
  ```
54
 
55
  *Returns:* `true` only if `x` and `y` represent the same thread of
56
  execution or neither `x` nor `y` represents a thread of execution.
57
 
58
  ``` cpp
59
- bool operator!=(thread::id x, thread::id y) noexcept;
60
  ```
61
 
62
- *Returns:* `!(x == y)`
 
63
 
64
- ``` cpp
65
- bool operator<(thread::id x, thread::id y) noexcept;
66
- ```
67
-
68
- *Returns:* A value such that `operator<` is a total ordering as
69
- described in  [[alg.sorting]].
70
-
71
- ``` cpp
72
- bool operator<=(thread::id x, thread::id y) noexcept;
73
- ```
74
-
75
- *Returns:* `!(y < x)`.
76
-
77
- ``` cpp
78
- bool operator>(thread::id x, thread::id y) noexcept;
79
- ```
80
-
81
- *Returns:* `y < x`.
82
-
83
- ``` cpp
84
- bool operator>=(thread::id x, thread::id y) noexcept;
85
- ```
86
-
87
- *Returns:* `!(x < y)`.
88
 
89
  ``` cpp
90
  template<class charT, class traits>
91
  basic_ostream<charT, traits>&
92
  operator<< (basic_ostream<charT, traits>& out, thread::id id);
93
  ```
94
 
95
  *Effects:* Inserts an unspecified text representation of `id` into
96
  `out`. For two objects of type `thread::id` `x` and `y`, if `x == y` the
97
- `thread::id` objects shall have the same text representation and if
98
- `x != y` the `thread::id` objects shall have distinct text
99
- representations.
100
 
101
  *Returns:* `out`.
102
 
103
  ``` cpp
104
  template<> struct hash<thread::id>;
105
  ```
106
 
107
- The specialization is enabled ([[unord.hash]]).
108
 
 
6
  public:
7
  id() noexcept;
8
  };
9
 
10
  bool operator==(thread::id x, thread::id y) noexcept;
11
+ strong_ordering operator<=>(thread::id x, thread::id y) noexcept;
 
 
 
 
12
 
13
  template<class charT, class traits>
14
  basic_ostream<charT, traits>&
15
  operator<<(basic_ostream<charT, traits>& out, thread::id id);
16
 
17
+ // hash support
18
  template<class T> struct hash;
19
  template<> struct hash<thread::id>;
20
  }
21
  ```
22
 
23
  An object of type `thread::id` provides a unique identifier for each
24
  thread of execution and a single distinct value for all `thread` objects
25
+ that do not represent a thread of execution [[thread.thread.class]].
26
  Each thread of execution has an associated `thread::id` object that is
27
  not equal to the `thread::id` object of any other thread of execution
28
  and that is not equal to the `thread::id` object of any `thread` object
29
  that does not represent threads of execution.
30
 
31
+ `thread::id` is a trivially copyable class [[class.prop]]. The library
32
+ may reuse the value of a `thread::id` of a terminated thread that can no
33
+ longer be joined.
34
 
35
  [*Note 1*: Relational operators allow `thread::id` objects to be used
36
  as keys in associative containers. — *end note*]
37
 
38
  ``` cpp
39
  id() noexcept;
40
  ```
41
 
42
+ *Ensures:* The constructed object does not represent a thread of
 
 
43
  execution.
44
 
45
  ``` cpp
46
  bool operator==(thread::id x, thread::id y) noexcept;
47
  ```
48
 
49
  *Returns:* `true` only if `x` and `y` represent the same thread of
50
  execution or neither `x` nor `y` represents a thread of execution.
51
 
52
  ``` cpp
53
+ strong_ordering operator<=>(thread::id x, thread::id y) noexcept;
54
  ```
55
 
56
+ Let P(`x`, `y`) be an unspecified total ordering over `thread::id` as
57
+ described in [[alg.sorting]].
58
 
59
+ *Returns:* `strong_ordering::less` if P(`x`, `y`) is `true`. Otherwise,
60
+ `strong_ordering::greater` if P(`y`, `x`) is `true`. Otherwise,
61
+ `strong_ordering::equal`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  ``` cpp
64
  template<class charT, class traits>
65
  basic_ostream<charT, traits>&
66
  operator<< (basic_ostream<charT, traits>& out, thread::id id);
67
  ```
68
 
69
  *Effects:* Inserts an unspecified text representation of `id` into
70
  `out`. For two objects of type `thread::id` `x` and `y`, if `x == y` the
71
+ `thread::id` objects have the same text representation and if `x != y`
72
+ the `thread::id` objects have distinct text representations.
 
73
 
74
  *Returns:* `out`.
75
 
76
  ``` cpp
77
  template<> struct hash<thread::id>;
78
  ```
79
 
80
+ The specialization is enabled [[unord.hash]].
81