From Jason Turner

[futures.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp5v3rfehu/{from.md → to.md} +17 -16
tmp/tmp5v3rfehu/{from.md → to.md} RENAMED
@@ -7,20 +7,20 @@ restricted to multi-threaded programs but can be useful in
7
  single-threaded programs as well.
8
 
9
  ``` cpp
10
  namespace std {
11
  enum class future_errc {
12
- broken_promise,
13
- future_already_retrieved,
14
- promise_already_satisfied,
15
- no_state
16
  };
17
 
18
  enum class launch : unspecified{} {
19
  async = unspecified{},
20
  deferred = unspecified{},
21
- implementation-defined{}
22
  };
23
 
24
  enum class future_status {
25
  ready,
26
  timeout,
@@ -55,29 +55,30 @@ namespace std {
55
 
56
  template <class> class packaged_task; // undefined
57
  template <class R, class... ArgTypes>
58
  class packaged_task<R(ArgTypes...)>;
59
 
60
- template <class R>
61
  void swap(packaged_task<R(ArgTypes...)>&, packaged_task<R(ArgTypes...)>&) noexcept;
62
 
63
  template <class R, class Alloc>
64
  struct uses_allocator<packaged_task<R>, Alloc>;
65
 
66
  template <class F, class... Args>
67
- future<typename result_of<F(Args...)>::type>
68
  async(F&& f, Args&&... args);
69
  template <class F, class... Args>
70
- future<typename result_of<F(Args...)>::type>
71
  async(launch policy, F&& f, Args&&... args);
72
  }
73
  ```
74
 
75
- The `enum` type `launch` is an *implementation-defined* bitmask type (
76
- [[bitmask.types]]) with `launch::async` and `launch::deferred` denoting
77
- individual bits. Implementations can provide bitmasks to specify
78
- restrictions on task interaction by functions launched by `async()`
79
- applicable to a corresponding subset of available launch policies.
80
- Implementations can extend the behavior of the first overload of
81
- `async()` by adding their extensions to the launch policy under the “as
82
- if” rule.
 
83
 
 
7
  single-threaded programs as well.
8
 
9
  ``` cpp
10
  namespace std {
11
  enum class future_errc {
12
+ broken_promise = implementation-defined,
13
+ future_already_retrieved = implementation-defined,
14
+ promise_already_satisfied = implementation-defined,
15
+ no_state = implementation-defined
16
  };
17
 
18
  enum class launch : unspecified{} {
19
  async = unspecified{},
20
  deferred = unspecified{},
21
+ implementation-defined
22
  };
23
 
24
  enum class future_status {
25
  ready,
26
  timeout,
 
55
 
56
  template <class> class packaged_task; // undefined
57
  template <class R, class... ArgTypes>
58
  class packaged_task<R(ArgTypes...)>;
59
 
60
+ template <class R, class... ArgTypes>
61
  void swap(packaged_task<R(ArgTypes...)>&, packaged_task<R(ArgTypes...)>&) noexcept;
62
 
63
  template <class R, class Alloc>
64
  struct uses_allocator<packaged_task<R>, Alloc>;
65
 
66
  template <class F, class... Args>
67
+ future<result_of_t<decay_t<F>(decay_t<Args>...)>>
68
  async(F&& f, Args&&... args);
69
  template <class F, class... Args>
70
+ future<result_of_t<decay_t<F>(decay_t<Args>...)>>
71
  async(launch policy, F&& f, Args&&... args);
72
  }
73
  ```
74
 
75
+ The `enum` type `launch` is a bitmask type ([[bitmask.types]]) with
76
+ `launch::async` and `launch::deferred` denoting individual bits.
77
+ Implementations can provide bitmasks to specify restrictions on task
78
+ interaction by functions launched by `async()` applicable to a
79
+ corresponding subset of available launch policies. Implementations can
80
+ extend the behavior of the first overload of `async()` by adding their
81
+ extensions to the launch policy under the “as if” rule.
82
+
83
+ The enum values of `future_errc` are distinct and not zero.
84