From Jason Turner

[futures.task.members]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpisig4xnn/{from.md → to.md} +23 -7
tmp/tmpisig4xnn/{from.md → to.md} RENAMED
@@ -6,11 +6,11 @@ packaged_task() noexcept;
6
 
7
  *Effects:* The object has no shared state and no stored task.
8
 
9
  ``` cpp
10
  template<class F>
11
- packaged_task(F&& f);
12
  ```
13
 
14
  *Constraints:* `remove_cvref_t<F>` is not the same type as
15
  `packaged_task<R(ArgTypes...)>`.
16
 
@@ -21,13 +21,29 @@ template<class F>
21
 
22
  *Effects:* Constructs a new `packaged_task` object with a shared state
23
  and initializes the object’s stored task with `std::forward<F>(f)`.
24
 
25
  *Throws:* Any exceptions thrown by the copy or move constructor of `f`,
26
- or `bad_alloc` if memory for the internal data structures could not be
27
  allocated.
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  ``` cpp
30
  packaged_task(packaged_task&& rhs) noexcept;
31
  ```
32
 
33
  *Effects:* Transfers ownership of `rhs`’s shared state to `*this`,
@@ -70,20 +86,20 @@ bool valid() const noexcept;
70
 
71
  ``` cpp
72
  future<R> get_future();
73
  ```
74
 
75
- *Returns:* A `future` object that shares the same shared state as
76
- `*this`.
77
-
78
  *Synchronization:* Calls to this function do not introduce data
79
  races  [[intro.multithread]] with calls to `operator()` or
80
  `make_ready_at_thread_exit`.
81
 
82
  [*Note 1*: Such calls need not synchronize with each
83
  other. — *end note*]
84
 
 
 
 
85
  *Throws:* A `future_error` object if an error occurs.
86
 
87
  *Error conditions:*
88
 
89
  - `future_already_retrieved` if `get_future` has already been called on
@@ -143,11 +159,11 @@ task stored in `*this`.
143
  [*Note 2*: This constructs a new shared state for `*this`. The old
144
  state is abandoned [[futures.state]]. — *end note*]
145
 
146
  *Throws:*
147
 
148
- - `bad_alloc` if memory for the new shared state could not be allocated.
149
- - any exception thrown by the move constructor of the task stored in the
150
  shared state.
151
  - `future_error` with an error condition of `no_state` if `*this` has no
152
  shared state.
153
 
 
6
 
7
  *Effects:* The object has no shared state and no stored task.
8
 
9
  ``` cpp
10
  template<class F>
11
+ explicit packaged_task(F&& f);
12
  ```
13
 
14
  *Constraints:* `remove_cvref_t<F>` is not the same type as
15
  `packaged_task<R(ArgTypes...)>`.
16
 
 
21
 
22
  *Effects:* Constructs a new `packaged_task` object with a shared state
23
  and initializes the object’s stored task with `std::forward<F>(f)`.
24
 
25
  *Throws:* Any exceptions thrown by the copy or move constructor of `f`,
26
+ or `bad_alloc` if memory for the internal data structures cannot be
27
  allocated.
28
 
29
+ ``` cpp
30
+ template<class F> packaged_task(F) -> packaged_task<see below>;
31
+ ```
32
+
33
+ *Constraints:* `&F::operator()` is well-formed when treated as an
34
+ unevaluated operand [[term.unevaluated.operand]] and either
35
+
36
+ - `F::operator()` is a non-static member function and
37
+ `decltype(&F::operator())` is either of the form
38
+ `R(G::*)(A...)` cv \\ₒₚₜ ` `noexceptₒₚₜ or of the form
39
+ `R(*)(G, A...) `noexceptₒₚₜ for a type `G`, or
40
+ - `F::operator()` is a static member function and
41
+ `decltype(&F::operator())` is of the form `R(*)(A...) `noexceptₒₚₜ .
42
+
43
+ *Remarks:* The deduced type is `packaged_task<R(A...)>`.
44
+
45
  ``` cpp
46
  packaged_task(packaged_task&& rhs) noexcept;
47
  ```
48
 
49
  *Effects:* Transfers ownership of `rhs`’s shared state to `*this`,
 
86
 
87
  ``` cpp
88
  future<R> get_future();
89
  ```
90
 
 
 
 
91
  *Synchronization:* Calls to this function do not introduce data
92
  races  [[intro.multithread]] with calls to `operator()` or
93
  `make_ready_at_thread_exit`.
94
 
95
  [*Note 1*: Such calls need not synchronize with each
96
  other. — *end note*]
97
 
98
+ *Returns:* A `future` object that shares the same shared state as
99
+ `*this`.
100
+
101
  *Throws:* A `future_error` object if an error occurs.
102
 
103
  *Error conditions:*
104
 
105
  - `future_already_retrieved` if `get_future` has already been called on
 
159
  [*Note 2*: This constructs a new shared state for `*this`. The old
160
  state is abandoned [[futures.state]]. — *end note*]
161
 
162
  *Throws:*
163
 
164
+ - `bad_alloc` if memory for the new shared state cannot be allocated.
165
+ - Any exception thrown by the move constructor of the task stored in the
166
  shared state.
167
  - `future_error` with an error condition of `no_state` if `*this` has no
168
  shared state.
169