tmp/tmp7dhfk9c6/{from.md → to.md}
RENAMED
|
@@ -15,33 +15,30 @@ template<class F, class... Args> explicit thread(F&& f, Args&&... args);
|
|
| 15 |
*Constraints:* `remove_cvref_t<F>` is not the same type as `thread`.
|
| 16 |
|
| 17 |
*Mandates:* The following are all `true`:
|
| 18 |
|
| 19 |
- `is_constructible_v<decay_t<F>, F>`,
|
| 20 |
-
- `(is_constructible_v<decay_t<Args>, Args> && ...)`,
|
| 21 |
-
- `is_move_constructible_v<decay_t<F>>`,
|
| 22 |
-
- `(is_move_constructible_v<decay_t<Args>> && ...)`, and
|
| 23 |
- `is_invocable_v<decay_t<F>, decay_t<Args>...>`.
|
| 24 |
|
| 25 |
-
*Preconditions:* `decay_t<F>` and each type in `decay_t<Args>` meet the
|
| 26 |
-
*Cpp17MoveConstructible* requirements.
|
| 27 |
-
|
| 28 |
*Effects:* The new thread of execution executes
|
| 29 |
|
| 30 |
``` cpp
|
| 31 |
-
invoke(
|
|
|
|
| 32 |
```
|
| 33 |
|
| 34 |
-
with the
|
| 35 |
-
thread. Any return value from this invocation is
|
|
|
|
| 36 |
|
| 37 |
[*Note 1*: This implies that any exceptions not thrown from the
|
| 38 |
invocation of the copy of `f` will be thrown in the constructing thread,
|
| 39 |
not the new thread. — *end note*]
|
| 40 |
|
| 41 |
If the invocation of `invoke` terminates with an uncaught exception,
|
| 42 |
-
`terminate` is
|
| 43 |
|
| 44 |
*Synchronization:* The completion of the invocation of the constructor
|
| 45 |
synchronizes with the beginning of the invocation of the copy of `f`.
|
| 46 |
|
| 47 |
*Ensures:* `get_id() != id()`. `*this` represents the newly started
|
|
|
|
| 15 |
*Constraints:* `remove_cvref_t<F>` is not the same type as `thread`.
|
| 16 |
|
| 17 |
*Mandates:* The following are all `true`:
|
| 18 |
|
| 19 |
- `is_constructible_v<decay_t<F>, F>`,
|
| 20 |
+
- `(is_constructible_v<decay_t<Args>, Args> && ...)`, and
|
|
|
|
|
|
|
| 21 |
- `is_invocable_v<decay_t<F>, decay_t<Args>...>`.
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
*Effects:* The new thread of execution executes
|
| 24 |
|
| 25 |
``` cpp
|
| 26 |
+
invoke(auto(std::forward<F>(f)), // for invoke, see [func.invoke]
|
| 27 |
+
auto(std::forward<Args>(args))...)
|
| 28 |
```
|
| 29 |
|
| 30 |
+
with the values produced by `auto` being materialized [[conv.rval]] in
|
| 31 |
+
the constructing thread. Any return value from this invocation is
|
| 32 |
+
ignored.
|
| 33 |
|
| 34 |
[*Note 1*: This implies that any exceptions not thrown from the
|
| 35 |
invocation of the copy of `f` will be thrown in the constructing thread,
|
| 36 |
not the new thread. — *end note*]
|
| 37 |
|
| 38 |
If the invocation of `invoke` terminates with an uncaught exception,
|
| 39 |
+
`terminate` is invoked [[except.terminate]].
|
| 40 |
|
| 41 |
*Synchronization:* The completion of the invocation of the constructor
|
| 42 |
synchronizes with the beginning of the invocation of the copy of `f`.
|
| 43 |
|
| 44 |
*Ensures:* `get_id() != id()`. `*this` represents the newly started
|