tmp/tmpsx82a79z/{from.md → to.md}
RENAMED
|
@@ -1,61 +1,68 @@
|
|
| 1 |
### Header `<future>` synopsis <a id="future.syn">[[future.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
enum class future_errc {
|
| 6 |
-
broken_promise = implementation-defined,
|
| 7 |
-
future_already_retrieved = implementation-defined,
|
| 8 |
-
promise_already_satisfied = implementation-defined,
|
| 9 |
-
no_state = implementation-defined
|
| 10 |
};
|
| 11 |
|
| 12 |
enum class launch : unspecified{} {
|
| 13 |
async = unspecified{},
|
| 14 |
deferred = unspecified{},
|
| 15 |
-
implementation-defined
|
| 16 |
};
|
| 17 |
|
| 18 |
enum class future_status {
|
| 19 |
ready,
|
| 20 |
timeout,
|
| 21 |
deferred
|
| 22 |
};
|
| 23 |
|
|
|
|
| 24 |
template<> struct is_error_code_enum<future_errc> : public true_type { };
|
| 25 |
error_code make_error_code(future_errc e) noexcept;
|
| 26 |
error_condition make_error_condition(future_errc e) noexcept;
|
| 27 |
|
| 28 |
const error_category& future_category() noexcept;
|
| 29 |
|
|
|
|
| 30 |
class future_error;
|
| 31 |
|
|
|
|
| 32 |
template<class R> class promise;
|
| 33 |
template<class R> class promise<R&>;
|
| 34 |
template<> class promise<void>;
|
| 35 |
|
| 36 |
template<class R>
|
| 37 |
void swap(promise<R>& x, promise<R>& y) noexcept;
|
| 38 |
|
| 39 |
template<class R, class Alloc>
|
| 40 |
struct uses_allocator<promise<R>, Alloc>;
|
| 41 |
|
|
|
|
| 42 |
template<class R> class future;
|
| 43 |
template<class R> class future<R&>;
|
| 44 |
template<> class future<void>;
|
| 45 |
|
|
|
|
| 46 |
template<class R> class shared_future;
|
| 47 |
template<class R> class shared_future<R&>;
|
| 48 |
template<> class shared_future<void>;
|
| 49 |
|
|
|
|
| 50 |
template<class> class packaged_task; // not defined
|
| 51 |
template<class R, class... ArgTypes>
|
| 52 |
class packaged_task<R(ArgTypes...)>;
|
| 53 |
|
| 54 |
template<class R, class... ArgTypes>
|
| 55 |
void swap(packaged_task<R(ArgTypes...)>&, packaged_task<R(ArgTypes...)>&) noexcept;
|
| 56 |
|
|
|
|
| 57 |
template<class F, class... Args>
|
| 58 |
[[nodiscard]] future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
|
| 59 |
async(F&& f, Args&&... args);
|
| 60 |
template<class F, class... Args>
|
| 61 |
[[nodiscard]] future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
|
|
|
|
| 1 |
### Header `<future>` synopsis <a id="future.syn">[[future.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
enum class future_errc {
|
| 6 |
+
broken_promise = implementation-defined // value of future_errc::broken_promise,
|
| 7 |
+
future_already_retrieved = implementation-defined // value of future_errc::future_already_retrieved,
|
| 8 |
+
promise_already_satisfied = implementation-defined // value of future_errc::promise_already_satisfied,
|
| 9 |
+
no_state = implementation-defined // value of future_errc::no_state
|
| 10 |
};
|
| 11 |
|
| 12 |
enum class launch : unspecified{} {
|
| 13 |
async = unspecified{},
|
| 14 |
deferred = unspecified{},
|
| 15 |
+
implementation-defined // last enumerator of launch
|
| 16 |
};
|
| 17 |
|
| 18 |
enum class future_status {
|
| 19 |
ready,
|
| 20 |
timeout,
|
| 21 |
deferred
|
| 22 |
};
|
| 23 |
|
| 24 |
+
// [futures.errors], error handling
|
| 25 |
template<> struct is_error_code_enum<future_errc> : public true_type { };
|
| 26 |
error_code make_error_code(future_errc e) noexcept;
|
| 27 |
error_condition make_error_condition(future_errc e) noexcept;
|
| 28 |
|
| 29 |
const error_category& future_category() noexcept;
|
| 30 |
|
| 31 |
+
// [futures.future.error], class future_error
|
| 32 |
class future_error;
|
| 33 |
|
| 34 |
+
// [futures.promise], class template promise
|
| 35 |
template<class R> class promise;
|
| 36 |
template<class R> class promise<R&>;
|
| 37 |
template<> class promise<void>;
|
| 38 |
|
| 39 |
template<class R>
|
| 40 |
void swap(promise<R>& x, promise<R>& y) noexcept;
|
| 41 |
|
| 42 |
template<class R, class Alloc>
|
| 43 |
struct uses_allocator<promise<R>, Alloc>;
|
| 44 |
|
| 45 |
+
// [futures.unique.future], class template future
|
| 46 |
template<class R> class future;
|
| 47 |
template<class R> class future<R&>;
|
| 48 |
template<> class future<void>;
|
| 49 |
|
| 50 |
+
// [futures.shared.future], class template shared_future
|
| 51 |
template<class R> class shared_future;
|
| 52 |
template<class R> class shared_future<R&>;
|
| 53 |
template<> class shared_future<void>;
|
| 54 |
|
| 55 |
+
// [futures.task], class template packaged_task
|
| 56 |
template<class> class packaged_task; // not defined
|
| 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 |
+
// [futures.async], function template async
|
| 64 |
template<class F, class... Args>
|
| 65 |
[[nodiscard]] future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
|
| 66 |
async(F&& f, Args&&... args);
|
| 67 |
template<class F, class... Args>
|
| 68 |
[[nodiscard]] future<invoke_result_t<decay_t<F>, decay_t<Args>...>>
|