Standard library header <execution> (C++17)
From cppreference.net
이 헤더는 execution 및 algorithm 라이브러리의 일부입니다.
클래스 |
||
|
(C++17)
|
클래스가 실행 정책을 나타내는지 테스트
(클래스 템플릿) |
|
|
네임스페이스
std::execution
에 정의됨
|
||
|
(C++17)
(C++17)
(C++17)
(C++20)
|
실행 정책 타입
(클래스) |
|
상수 |
||
|
네임스페이스
std::execution
에 정의됨
|
||
|
(C++17)
(C++17)
(C++17)
(C++20)
|
전역 실행 정책 객체
(상수) |
|
|
이 섹션은 불완전합니다
이유: 실행 라이브러리 하위 페이지 링크 |
시놉시스
namespace std { // 실행 정책 타입 특성 template<class T> struct is_execution_policy; // freestanding template<class T> constexpr bool is_execution_policy_v = is_execution_policy<T>::value; // 독립 실행 환경 } namespace std::실행 { // sequenced execution policy class sequenced_policy; // 병렬 실행 정책 class parallel_policy; // 병렬 및 비순차 실행 정책 class parallel_unsequenced_policy; // 비순차 실행 정책 class unsequenced_policy; // 실행 정책 객체들 inline constexpr sequenced_policy seq{ /* 미지정 */ }; inline constexpr parallel_policy par{ /* 미지정 */ }; inline constexpr parallel_unsequenced_policy par_unseq{ /* 지정되지 않음 */ }; inline constexpr unsequenced_policy unseq{ /* 지정되지 않음 */ }; } namespace std { // helper concepts template<class T> concept /*movable-value*/ = /* 설명 참조 */; // 설명 전용 template<class From, class To> concept /*decays-to*/ = same_as<decay_t<From>, To>; // 설명 전용 template<class T> concept /*클래스 타입*/ = /*decays-to*/<T, T> && is_class_v<T>; // 설명 전용 // 쿼리 가능한 객체들 template<class T> concept /*queryable*/ = /* 설명 참조 */; // 설명 전용 // 쿼리 struct forwarding_query_t { /* 지정되지 않음 */ }; struct get_allocator_t { /* 지정되지 않음 */ }; struct get_stop_token_t { /* 지정되지 않음 */ }; inline constexpr forwarding_query_t forwarding_query{}; inline constexpr get_allocator_t get_allocator{}; inline constexpr get_stop_token_t get_stop_token{}; template<class T> using stop_token_of_t = remove_cvref_t<decltype(get_stop_token(declval<T>()))>; template<class T> concept /*전달-쿼리*/ = forwarding_query(T{}); // 설명 전용 } namespace std::실행 { // 쿼리 struct get_domain_t { /* 지정되지 않음 */ }; struct get_scheduler_t { /* 지정되지 않음 */ }; struct get_delegation_scheduler_t { /* 지정되지 않음 */ }; struct get_forward_progress_guarantee_t { /* 지정되지 않음 */ }; template<class CPO> struct get_completion_scheduler_t { /* 지정되지 않음 */ }; inline constexpr get_domain_t get_domain{}; inline constexpr get_scheduler_t get_scheduler{}; inline constexpr get_delegation_scheduler_t get_delegation_scheduler{}; enum class forward_progress_guarantee; inline constexpr get_forward_progress_guarantee_t get_forward_progress_guarantee{}; template<class CPO> constexpr get_completion_scheduler_t<CPO> get_completion_scheduler{}; struct get_env_t { /* 지정되지 않음 */ }; inline constexpr get_env_t get_env{}; template<class T> using env_of_t = decltype(get_env(declval<T>())); template<class QueryTag, class ValueType> struct prop; template</*queryable*/... Envs> struct env; // 실행 도메인 struct default_domain; // 스케줄러 struct scheduler_t {}; template<class Sch> concept scheduler = /* 설명 참조 */; // receivers struct receiver_t {}; template<class Rcvr> concept receiver = /* 설명 참조 */; template<class Rcvr, class Completions> concept receiver_of = /* 설명 참조 */; struct set_value_t { /* 지정되지 않음 */ }; struct set_error_t { /* 미지정 */ }; struct set_stopped_t { /* 미지정 */ }; inline constexpr set_value_t set_value{}; inline constexpr set_error_t set_error{}; inline constexpr set_stopped_t set_stopped{}; // 연산 상태 struct operation_state_t {}; template<class O> concept operation_state = /* 설명 참조 */; struct start_t; inline constexpr start_t start{}; // 발신자 struct sender_t {}; template<class Sndr> concept sender = /* 설명 참조 */; template<class Sndr, class Env = env<>> concept sender_in = /* 설명 참조 */; template<class Sndr, class Rcvr> concept sender_to = /* 설명 참조 */; template<class... Ts> struct /*type-list*/; // 설명 전용 // completion signatures struct get_completion_signatures_t; inline constexpr get_completion_signatures_t get_completion_signatures{}; template<class Sndr, class Env = env<>> requires sender_in<Sndr, Env> using completion_signatures_of_t = /*호출-결과-t*/<get_completion_signatures_t, Sndr, Env>; template<class... Ts> using /*decayed-tuple*/ = tuple<decay_t<Ts>...>; // 설명 전용 template<class... Ts> using /*variant-or-empty*/ = /* 설명 참조 */; // 설명 전용 template<class Sndr, class Env = env<>, template<class...> class Tuple = /*decayed-tuple*/, template<class...> class Variant = /*variant-or-empty*/> requires sender_in<Sndr, Env> using value_types_of_t = /* 설명 참조 */; template<class Sndr, class Env = env<>, template<class...> class Variant = /*variant-or-empty*/> requires sender_in<Sndr, Env> using error_types_of_t = /* 설명 참조 */; template<class Sndr, class Env = env<>> requires sender_in<Sndr, Env> constexpr bool sends_stopped = /* 설명 참조 */; template<class Sndr, class Env> using /*single-sender-value-type*/ = /* 설명 참조 */; // 설명 전용 template<class Sndr, class Env> concept /*단일 발신자*/ = /* 설명 참조 */; // 설명 전용 template<sender Sndr> using tag_of_t = /* 설명 참조 */; // 발신자 변환 template<class Domain, sender Sndr, /*queryable*/... Env> requires(sizeof...(Env) <= 1) constexpr sender decltype(auto) transform_sender( Domain dom, Sndr&& sndr, const Env&... env) noexcept(/* 설명 참조 */); // 환경 변환 template<class Domain, sender Sndr, /*queryable*/ Env> constexpr /*queryable*/ decltype(auto) transform_env(Domain dom, Sndr&& sndr, Env&& env) noexcept; // 송신자 알고리즘 애플리케이션 template<class Domain, class Tag, sender Sndr, class... Args> constexpr decltype(auto) apply_sender(Domain dom, Tag, Sndr&& sndr, Args&&... args) noexcept(/* 설명 참조 */); // the connect sender algorithm struct connect_t; inline constexpr connect_t connect{}; template<class Sndr, class Rcvr> using connect_result_t = decltype(connect(declval<Sndr>(), declval<Rcvr>())); // sender factories struct just_t { /* 미지정 */ }; struct just_error_t { /* 지정되지 않음 */ }; struct just_stopped_t { /* 지정되지 않음 */ }; struct schedule_t { /* 지정되지 않음 */ }; inline constexpr just_t just{}; inline constexpr just_error_t just_error{}; inline constexpr just_stopped_t just_stopped{}; inline constexpr schedule_t schedule{}; inline constexpr /* 지정되지 않음 */ read_env{}; template<scheduler Sndr> using schedule_result_t = decltype(schedule(declval<Sndr>())); // sender adaptors template</*class-type*/ D> struct sender_adaptor_closure {}; struct starts_on_t { /* 미지정 */ }; struct continues_on_t { /* 지정되지 않음 */ }; struct on_t { /* 지정되지 않음 */ }; struct schedule_from_t { /* 미지정 */ }; struct then_t { /* 지정되지 않음 */ }; struct upon_error_t { /* 미지정 */ }; struct upon_stopped_t { /* 미지정 */ }; struct let_value_t { /* 미지정 */ }; struct let_error_t { /* 지정되지 않음 */ }; struct let_stopped_t { /* 미지정 */ }; struct bulk_t { /* 미지정 */ }; struct split_t { /* 미지정 */ }; struct when_all_t { /* 지정되지 않음 */ }; struct when_all_with_variant_t { /* 미지정 */ }; struct into_variant_t { /* 미지정 */ }; struct stopped_as_optional_t { /* 지정되지 않음 */ }; struct stopped_as_error_t { /* 미지정 */ }; inline constexpr starts_on_t starts_on{}; inline constexpr continues_on_t continues_on{}; inline constexpr on_t on{}; inline constexpr schedule_from_t schedule_from{}; inline constexpr then_t then{}; inline constexpr upon_error_t upon_error{}; inline constexpr upon_stopped_t upon_stopped{}; inline constexpr let_value_t let_value{}; inline constexpr let_error_t let_error{}; inline constexpr let_stopped_t let_stopped{}; inline constexpr bulk_t bulk{}; inline constexpr split_t split{}; inline constexpr when_all_t when_all{}; inline constexpr when_all_with_variant_t when_all_with_variant{}; inline constexpr into_variant_t into_variant{}; inline constexpr stopped_as_optional_t stopped_as_optional{}; inline constexpr stopped_as_error_t stopped_as_error{}; // 송신자 및 수신자 유틸리티 template<class Fn> concept /*완료-서명*/ = /* 설명 참조 */; // 설명 전용 template</*완료-시그니처*/... Fns> struct completion_signatures {}; template<class Sigs> concept /*valid-completion-signatures*/ = /* 설명 참조 */; // 설명 전용 template</*valid-completion-signatures*/ InputSignatures, /*valid-completion-signatures*/ AdditionalSignatures = completion_signatures<>, template<class...> class SetValue = /* 설명 참조 */, template<class> class SetError = /* 설명 참조 */, /*valid-completion-signatures*/ SetStopped = completion_signatures<set_stopped_t()>> using transform_completion_signatures = completion_signatures</* 설명 참조 */>; template<sender Sndr, class Env = env<>, /*valid-completion-signatures*/ AdditionalSignatures = completion_signatures<>, template<class...> class SetValue = /* 설명 참조 */, template<class> class SetError = /* 설명 참조 */, /*valid-completion-signatures*/ SetStopped = completion_signatures<set_stopped_t()>> requires sender_in<Sndr, Env> using transform_completion_signatures_of = transform_completion_signatures<completion_signatures_of_t<Sndr, Env>, AdditionalSignatures, SetValue, SetError, SetStopped>; // run_loop class run_loop; } namespace std::this_thread { // consumers struct sync_wait_t { /* 지정되지 않음 */ }; struct sync_wait_with_variant_t { /* 지정되지 않음 */ }; inline constexpr sync_wait_t sync_wait{}; inline constexpr sync_wait_with_variant_t sync_wait_with_variant{}; } namespace std::실행 { struct as_awaitable_t { /* 지정되지 않음 */ }; inline constexpr as_awaitable_t as_awaitable{}; template</*클래스 타입*/ Promise> struct with_awaitable_senders; }
헬퍼 개념
namespace std { template<class T> concept /*movable-value*/ = // 설명 전용 move_constructible<decay_t<T>> && constructible_from<decay_t<T>, T> && (!is_array_v<remove_reference_t<T>>); } namespace std { template<class T> concept /*queryable*/ = destructible<T>; // 설명 전용 } namespace std::execution { template<class Sndr, class Env> concept /*single-sender*/ = sender_in<Sndr, Env> && requires { typename /*single-sender-value-type*/<Sndr, Env>; }; }
헬퍼 클래스
namespace std::execution { struct /*empty-variant*/ { // 설명 전용 /*empty-variant*/() = delete; }; }
enum
std::forward_progress_guarantee
namespace std::execution { enum class forward_progress_guarantee { concurrent, parallel, weakly_parallel }; }
개념
scheduler
namespace std::execution { template<class Sch> concept scheduler = derived_from<typename remove_cvref_t<Sch>::scheduler_concept, scheduler_t> && /*queryable*/<Sch> && requires(Sch&& sch) { { schedule(std::forward<Sch>(sch)) } -> sender; { auto(get_completion_scheduler<set_value_t>( get_env(schedule(std::forward<Sch>(sch)))) } -> same_as<remove_cvref_t<Sch>>; } && equality_comparable<remove_cvref_t<Sch>> && copy_constructible<remove_cvref_t<Sch>>; }
개념
receiver
namespace std::execution { template<class Rcvr> concept receiver = derived_from<typename remove_cvref_t<Rcvr>::receiver_concept, receiver_t> && requires(const remove_cvref_t<Rcvr>& rcvr) { { get_env(rcvr) } -> /*queryable*/; } && move_constructible<remove_cvref_t<Rcvr>> && // 우측값은 이동 가능하고, constructible_from<remove_cvref_t<Rcvr>, Rcvr>; // 좌측값은 복사 가능함 template<class Signature, class Rcvr> concept /*valid-completion-for*/ = requires(Signature* sig) { []<class Tag, class... Args>(Tag(*)(Args...)) requires /*callable*/<Tag, remove_cvref_t<Rcvr>, Args...> { } (sig); }; template<class Rcvr, class Completions> concept /*has-completions*/ = requires(Completions* completions) { []</*valid-completion-for*/<Rcvr>... Sigs>(completion_signatures<Sigs...>*) { }(completions); }; template<class Rcvr, class Completions> concept receiver_of = receiver<Rcvr> && /*has-completions*/<Rcvr, Completions>; }
개념
operation_state
namespace std::execution { template<class O> concept operation_state = derived_from<typename O::operation_state_concept, operation_state_t> && is_object_v<O> && requires(O& o) { { start(o) } noexcept; }; }