tmp/tmplhnwrr_z/{from.md → to.md}
RENAMED
|
@@ -27,18 +27,18 @@ namespace std {
|
|
| 27 |
// setting the result with deferred notification
|
| 28 |
void set_value_at_thread_exit(see below);
|
| 29 |
void set_exception_at_thread_exit(exception_ptr p);
|
| 30 |
};
|
| 31 |
|
| 32 |
-
template<class R>
|
| 33 |
-
void swap(promise<R>& x, promise<R>& y) noexcept;
|
| 34 |
-
|
| 35 |
template<class R, class Alloc>
|
| 36 |
struct uses_allocator<promise<R>, Alloc>;
|
| 37 |
}
|
| 38 |
```
|
| 39 |
|
|
|
|
|
|
|
|
|
|
| 40 |
The implementation provides the template `promise` and two
|
| 41 |
specializations, `promise<R&>` and `promise<{}void>`. These differ only
|
| 42 |
in the argument type of the member functions `set_value` and
|
| 43 |
`set_value_at_thread_exit`, as set out in their descriptions, below.
|
| 44 |
|
|
@@ -51,12 +51,12 @@ the promise object.
|
|
| 51 |
template<class R, class Alloc>
|
| 52 |
struct uses_allocator<promise<R>, Alloc>
|
| 53 |
: true_type { };
|
| 54 |
```
|
| 55 |
|
| 56 |
-
*Preconditions:* `Alloc` meets the *Cpp17Allocator*
|
| 57 |
-
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
promise();
|
| 61 |
template<class Allocator>
|
| 62 |
promise(allocator_arg_t, const Allocator& a);
|
|
@@ -101,19 +101,19 @@ to the call to `swap`. `other` has the shared state (if any) that
|
|
| 101 |
|
| 102 |
``` cpp
|
| 103 |
future<R> get_future();
|
| 104 |
```
|
| 105 |
|
| 106 |
-
*Returns:* A `future<R>` object with the same shared state as `*this`.
|
| 107 |
-
|
| 108 |
*Synchronization:* Calls to this function do not introduce data
|
| 109 |
races [[intro.multithread]] with calls to `set_value`, `set_exception`,
|
| 110 |
`set_value_at_thread_exit`, or `set_exception_at_thread_exit`.
|
| 111 |
|
| 112 |
[*Note 1*: Such calls need not synchronize with each
|
| 113 |
other. — *end note*]
|
| 114 |
|
|
|
|
|
|
|
| 115 |
*Throws:* `future_error` if `*this` has no shared state or if
|
| 116 |
`get_future` has already been called on a `promise` with the same shared
|
| 117 |
state as `*this`.
|
| 118 |
|
| 119 |
*Error conditions:*
|
|
|
|
| 27 |
// setting the result with deferred notification
|
| 28 |
void set_value_at_thread_exit(see below);
|
| 29 |
void set_exception_at_thread_exit(exception_ptr p);
|
| 30 |
};
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
template<class R, class Alloc>
|
| 33 |
struct uses_allocator<promise<R>, Alloc>;
|
| 34 |
}
|
| 35 |
```
|
| 36 |
|
| 37 |
+
For the primary template, `R` shall be an object type that meets the
|
| 38 |
+
*Cpp17Destructible* requirements.
|
| 39 |
+
|
| 40 |
The implementation provides the template `promise` and two
|
| 41 |
specializations, `promise<R&>` and `promise<{}void>`. These differ only
|
| 42 |
in the argument type of the member functions `set_value` and
|
| 43 |
`set_value_at_thread_exit`, as set out in their descriptions, below.
|
| 44 |
|
|
|
|
| 51 |
template<class R, class Alloc>
|
| 52 |
struct uses_allocator<promise<R>, Alloc>
|
| 53 |
: true_type { };
|
| 54 |
```
|
| 55 |
|
| 56 |
+
*Preconditions:* `Alloc` meets the *Cpp17Allocator*
|
| 57 |
+
requirements [[allocator.requirements.general]].
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
promise();
|
| 61 |
template<class Allocator>
|
| 62 |
promise(allocator_arg_t, const Allocator& a);
|
|
|
|
| 101 |
|
| 102 |
``` cpp
|
| 103 |
future<R> get_future();
|
| 104 |
```
|
| 105 |
|
|
|
|
|
|
|
| 106 |
*Synchronization:* Calls to this function do not introduce data
|
| 107 |
races [[intro.multithread]] with calls to `set_value`, `set_exception`,
|
| 108 |
`set_value_at_thread_exit`, or `set_exception_at_thread_exit`.
|
| 109 |
|
| 110 |
[*Note 1*: Such calls need not synchronize with each
|
| 111 |
other. — *end note*]
|
| 112 |
|
| 113 |
+
*Returns:* A `future<R>` object with the same shared state as `*this`.
|
| 114 |
+
|
| 115 |
*Throws:* `future_error` if `*this` has no shared state or if
|
| 116 |
`get_future` has already been called on a `promise` with the same shared
|
| 117 |
state as `*this`.
|
| 118 |
|
| 119 |
*Error conditions:*
|