tmp/tmp_ajy4tnf/{from.md → to.md}
RENAMED
|
@@ -12,10 +12,12 @@ namespace std {
|
|
| 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 |
```
|
|
@@ -26,10 +28,16 @@ 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
|
|
@@ -64,17 +72,37 @@ described in [[alg.sorting]].
|
|
| 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
|
| 70 |
-
`out`.
|
| 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]].
|
|
|
|
| 12 |
|
| 13 |
template<class charT, class traits>
|
| 14 |
basic_ostream<charT, traits>&
|
| 15 |
operator<<(basic_ostream<charT, traits>& out, thread::id id);
|
| 16 |
|
| 17 |
+
template<class charT> struct formatter<thread::id, charT>;
|
| 18 |
+
|
| 19 |
// hash support
|
| 20 |
template<class T> struct hash;
|
| 21 |
template<> struct hash<thread::id>;
|
| 22 |
}
|
| 23 |
```
|
|
|
|
| 28 |
Each thread of execution has an associated `thread::id` object that is
|
| 29 |
not equal to the `thread::id` object of any other thread of execution
|
| 30 |
and that is not equal to the `thread::id` object of any `thread` object
|
| 31 |
that does not represent threads of execution.
|
| 32 |
|
| 33 |
+
The *text representation* for the character type `charT` of an object of
|
| 34 |
+
type `thread::id` is an unspecified sequence of `charT` such that, for
|
| 35 |
+
two objects of type `thread::id` `x` and `y`, if `x == y` is `true`, the
|
| 36 |
+
`thread::id` objects have the same text representation, and if `x != y`
|
| 37 |
+
is `true`, the `thread::id` objects have distinct text representations.
|
| 38 |
+
|
| 39 |
`thread::id` is a trivially copyable class [[class.prop]]. The library
|
| 40 |
may reuse the value of a `thread::id` of a terminated thread that can no
|
| 41 |
longer be joined.
|
| 42 |
|
| 43 |
[*Note 1*: Relational operators allow `thread::id` objects to be used
|
|
|
|
| 72 |
template<class charT, class traits>
|
| 73 |
basic_ostream<charT, traits>&
|
| 74 |
operator<< (basic_ostream<charT, traits>& out, thread::id id);
|
| 75 |
```
|
| 76 |
|
| 77 |
+
*Effects:* Inserts the text representation for `charT` of `id` into
|
| 78 |
+
`out`.
|
|
|
|
|
|
|
| 79 |
|
| 80 |
*Returns:* `out`.
|
| 81 |
|
| 82 |
+
``` cpp
|
| 83 |
+
template<class charT> struct formatter<thread::id, charT>;
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
`formatter<thread::id, charT>` interprets *format-spec* as a
|
| 87 |
+
*thread-id-format-spec*. The syntax of format specifications is as
|
| 88 |
+
follows:
|
| 89 |
+
|
| 90 |
+
``` bnf
|
| 91 |
+
thread-id-format-spec
|
| 92 |
+
fill-and-alignₒₚₜ widthₒₚₜ
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
[*Note 1*: The productions *fill-and-align* and *width* are described
|
| 96 |
+
in [[format.string.std]]. — *end note*]
|
| 97 |
+
|
| 98 |
+
If the *align* option is omitted it defaults to `>`.
|
| 99 |
+
|
| 100 |
+
A `thread::id` object is formatted by writing its text representation
|
| 101 |
+
for `charT` to the output with additional padding and adjustments as
|
| 102 |
+
specified by the format specifiers.
|
| 103 |
+
|
| 104 |
``` cpp
|
| 105 |
template<> struct hash<thread::id>;
|
| 106 |
```
|
| 107 |
|
| 108 |
The specialization is enabled [[unord.hash]].
|