Namespaces
Variants

Standard library header <execution> (C++17)

From cppreference.net
Standard library headers

Dieser Header ist Teil der execution - und algorithm -Bibliotheken.

Inhaltsverzeichnis

Klassen

prüft, ob eine Klasse eine Ausführungsrichtlinie repräsentiert
(Klassentemplate)
Definiert im Namespace std::execution
Ausführungsrichtlinien-Typen
(Klasse)

Konstanten

Definiert im Namespace std::execution
(C++17) (C++17) (C++17) (C++20)
globale Ausführungsrichtlinien-Objekte
(Konstante)

Übersicht

namespace std {
  // Ausführungsrichtlinien-Typmerkmal
  template<class T>
  struct is_execution_policy;                                           // freestanding
  template<class T>
  constexpr bool is_execution_policy_v = is_execution_policy<T>::Wert; // freestanding
}
namespace std::Ausführung {
  // sequenzierte Ausführungsstrategie
  class sequenced_policy;
  // parallele Ausführungsrichtlinie
  class parallel_policy;
  // parallele und unsequenzierte Ausführungsrichtlinie
  class parallel_unsequenced_policy;
  // unsequenced execution policy
  class unsequenced_policy;
  // Ausführungsrichtlinien-Objekte
  inline constexpr sequenced_policy seq{ /* nicht spezifiziert */ };
  inline constexpr parallel_policy par{ /* nicht spezifiziert */ };
  inline constexpr parallel_unsequenced_policy par_unseq{ /* nicht spezifiziert */ };
  inline constexpr unsequenced_policy unseq{ /* nicht spezifiziert */ };
}
namespace std {
  // Hilfskonzepte
  template<class T>
  concept /*beweglicher Wert*/ = /* siehe Beschreibung */; // exposition only
  template<class From, class To>
  concept /*decays-to*/ = same_as<decay_t<From>, To>; // exposition only
  template<class T>
  concept /*class-type*/ = /*decays-to*/<T, T> && is_class_v<T>; // exposition only
  // abfragbare Objekte
  template<class T>
  concept /*abfragbar*/ = /* siehe Beschreibung */; // exposition only
  // Abfragen
  struct forwarding_query_t
  { /* nicht spezifiziert */
  };
  struct get_allocator_t
  { /* nicht spezifiziert */
  };
  struct get_stop_token_t
  { /* nicht spezifiziert */
  };
  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 /*Weiterleitungsabfrage*/ = forwarding_query(T{}); // exposition only
}
namespace std::Ausführung {
  // Abfragen
  struct get_domain_t
  { /* nicht spezifiziert */
  };
  struct get_scheduler_t
  { /* nicht spezifiziert */
  };
  struct get_delegation_scheduler_t
  { /* nicht spezifiziert */
  };
  struct get_forward_progress_guarantee_t
  { /* nicht spezifiziert */
  };
  template<class CPO>
  struct get_completion_scheduler_t
  { /* nicht spezifiziert */
  };
  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
  { /* nicht spezifiziert */
  };
  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</*abfragbar*/... Envs>
  struct env;
  // Ausführungsdomänen
  struct default_domain;
  // Scheduler
  struct scheduler_t
  {};
  template<class Sch>
  concept scheduler = /* siehe Beschreibung */;
  // Empfänger
  struct receiver_t
  {};
  template<class Rcvr>
  concept receiver = /* siehe Beschreibung */;
  template<class Rcvr, class Completions>
  concept receiver_of = /* siehe Beschreibung */;
  struct set_value_t
  { /* nicht spezifiziert */
  };
  struct set_error_t
  { /* nicht spezifiziert */
  };
  struct set_stopped_t
  { /* nicht spezifiziert */
  };
  inline constexpr set_value_t set_value{};
  inline constexpr set_error_t set_error{};
  inline constexpr set_stopped_t set_stopped{};
  // Betriebszustände
  struct operation_state_t
  {};
  template<class O>
  concept operation_state = /* siehe Beschreibung */;
  struct start_t;
  inline constexpr start_t start{};
  // Sender
  struct sender_t
  {};
  template<class Sndr>
  concept sender = /* siehe Beschreibung */;
  template<class Sndr, class Env = env<>>
  concept sender_in = /* siehe Beschreibung */;
  template<class Sndr, class Rcvr>
  concept sender_to = /* siehe Beschreibung */;
  template<class... Ts>
  struct /*type-list*/; // exposition only
  // Signaturvervollständigungen
  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 =
    /*call-result-t*/<get_completion_signatures_t, Sndr, Env>;
  template<class... Ts>
  using /*decayed-tuple*/ = tuple<decay_t<Ts>...>; // exposition only
  template<class... Ts>
  using /*variant-or-empty*/ = /* siehe Beschreibung */; // exposition only
  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 = /* siehe Beschreibung */;
  template<class Sndr,
           class Env                        = env<>,
           template<class...> class Variant = /*variant-or-empty*/>
    requires sender_in<Sndr, Env>
  using error_types_of_t = /* siehe Beschreibung */;
  template<class Sndr, class Env = env<>>
    requires sender_in<Sndr, Env>
  constexpr bool sends_stopped = /* siehe Beschreibung */;
  template<class Sndr, class Env>
  using /*single-sender-value-type*/ = /* siehe Beschreibung */; // exposition only
  template<class Sndr, class Env>
  concept /*Single-Sender*/ = /* siehe Beschreibung */; // exposition only
  template<sender Sndr>
  using tag_of_t = /* siehe Beschreibung */;
  // Sender-Transformationen
  template<class Domain, sender Sndr, /*abfragbar*/... Env>
    requires(sizeof...(Env) <= 1)
  constexpr sender decltype(auto) transform_sender(
    Domain dom,
    Sndr&& sndr,
    const Env&... env) noexcept(/* siehe Beschreibung */);
  // Umgebungstransformationen
  template<class Domain, sender Sndr, /*abfragbar*/ Env>
  constexpr /*abfragbar*/ decltype(auto) transform_env(Domain dom,
                                                       Sndr&& sndr,
                                                       Env&& env) noexcept;
  // Sender-Algorithmus-Anwendung
  template<class Domain, class Tag, sender Sndr, class... Args>
  constexpr decltype(auto) apply_sender(Domain dom,
                                        Tag,
                                        Sndr&& sndr,
                                        Args&&... args) noexcept(/* siehe Beschreibung */);
  // der Verbindungssender-Algorithmus
  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
  { /* nicht spezifiziert */
  };
  struct just_error_t
  { /* nicht spezifiziert */
  };
  struct just_stopped_t
  { /* nicht spezifiziert */
  };
  struct schedule_t
  { /* nicht spezifiziert */
  };
  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 /* nicht spezifiziert */ read_env{};
  template<scheduler Sndr>
  using schedule_result_t = decltype(schedule(declval<Sndr>()));
  // Sender-Adapter
  template</*class-type*/ D>
  struct sender_adaptor_closure
  {};
  struct starts_on_t
  { /* nicht spezifiziert */
  };
  struct continues_on_t
  { /* nicht spezifiziert */
  };
  struct on_t
  { /* nicht spezifiziert */
  };
  struct schedule_from_t
  { /* nicht spezifiziert */
  };
  struct then_t
  { /* nicht spezifiziert */
  };
  struct upon_error_t
  { /* nicht spezifiziert */
  };
  struct upon_stopped_t
  { /* nicht spezifiziert */
  };
  struct let_value_t
  { /* nicht spezifiziert */
  };
  struct let_error_t
  { /* nicht spezifiziert */
  };
  struct let_stopped_t
  { /* nicht spezifiziert */
  };
  struct bulk_t
  { /* nicht spezifiziert */
  };
  struct split_t
  { /* nicht spezifiziert */
  };
  struct when_all_t
  { /* nicht spezifiziert */
  };
  struct when_all_with_variant_t
  { /* nicht spezifiziert */
  };
  struct into_variant_t
  { /* nicht spezifiziert */
  };
  struct stopped_as_optional_t
  { /* nicht spezifiziert */
  };
  struct stopped_as_error_t
  { /* nicht spezifiziert */
  };
  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{};
  // Sender- und Empfänger-Utilities
  template<class Fn>
  concept /*Signatur der Vervollständigung*/ = /* siehe Beschreibung */; // exposition only
  template</*Signatur der Vervollständigung*/... Fns>
  struct completion_signatures
  {};
  template<class Sigs>
  concept /*gültige-Abschluss-Signaturen*/ = /* siehe Beschreibung */; // exposition only
  template</*gültige-Abschluss-Signaturen*/ InputSignatures,
           /*gültige-Abschluss-Signaturen*/ AdditionalSignatures = completion_signatures<>,
           template<class...> class SetValue                    = /* siehe Beschreibung */,
           template<class> class SetError                       = /* siehe Beschreibung */,
           /*gültige-Abschluss-Signaturen*/ SetStopped =
             completion_signatures<set_stopped_t()>>
  using transform_completion_signatures = completion_signatures</* siehe Beschreibung */>;
  template<sender Sndr,
           class Env                                            = env<>,
           /*gültige-Abschluss-Signaturen*/ AdditionalSignatures = completion_signatures<>,
           template<class...> class SetValue                    = /* siehe Beschreibung */,
           template<class> class SetError                       = /* siehe Beschreibung */,
           /*gültige-Abschluss-Signaturen*/ 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 {
  // Konsumenten
  struct sync_wait_t
  { /* nicht spezifiziert */
  };
  struct sync_wait_with_variant_t
  { /* nicht spezifiziert */
  };
  inline constexpr sync_wait_t sync_wait{};
  inline constexpr sync_wait_with_variant_t sync_wait_with_variant{};
}
namespace std::Ausführung {
  struct as_awaitable_t
  { /* nicht spezifiziert */
  };
  inline constexpr as_awaitable_t as_awaitable{};
  template</*class-type*/ Promise>
  struct with_awaitable_senders;
}

Hilfskonzepte

namespace std {
  template<class T>
  concept /*movable-value*/ = // nur zur Darstellung
    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>; // nur zur Darstellung
}
namespace std::execution {
  template<class Sndr, class Env>
  concept /*single-sender*/ = sender_in<Sndr, Env> && requires {
    typename /*single-sender-value-type*/<Sndr, Env>;
  };
}

Hilfsklassen

namespace std::execution {
  struct /*empty-variant*/
  { // exposition only
    /*empty-variant*/() = delete;
  };
}
**Übersetzung:**
namespace std::execution {
  struct /*leere-Variante*/
  { // nur zur Darstellung
    /*leere-Variante*/() = delete;
  };
}
**Erläuterung der Übersetzung:** - `/*empty-variant*/` → `/*leere-Variante*/` (technischer Begriff für eine leere Variante) - `// exposition only` → `// nur zur Darstellung` (Kommentar zur Dokumentation) - HTML-Tags, Attribute und Code innerhalb der `
`-Tags bleiben unverändert
- C++-spezifische Begriffe wie `namespace`, `struct`, `delete` wurden nicht übersetzt

enum std::forward_progress_guarantee

namespace std::execution {
  enum class forward_progress_guarantee
  {
    concurrent,
    parallel,
    weakly_parallel
  };
}

Konzept scheduler

namespace std::execution {
  template<class Sch>
  concept scheduler =
    derived_from<typename remove_cvref_t<Sch>::scheduler_concept, scheduler_t> &&
    /*abfragbar*/<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>>;
}

Konzept 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>> && // Rvalues sind beweglich, und
    constructible_from<remove_cvref_t<Rcvr>, Rcvr>;  // Lvalues sind kopierbar
  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>;
}

Konzept 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;
    };
}