Espacios de nombres
Variantes
Acciones

Archivo de encabezado de la biblioteca estándar <execution> (C++17)

De cppreference.com
< cpp‎ | header
 
 
Archivos de encabezado de la biblioteca estándar
 

Este archivo de encabezado es parte de las bibliotecas de ejecución y algoritmos.

Contenido

Clases

Comprueba si una clase representa una política de ejecución.
(plantilla de clase) [editar]
Definido en el espacio de nombres std::execution
Tipos de políticas de ejecución.
(clase) [editar]

Constantes

Definido en el espacio de nombres std::execution
(C++17)(C++17)(C++17)(C++20)
Objetos de políticas de ejecución globales.
(constante) [editar]

[editar] Sinopsis

namespace std {
  // rasgo de tipo de política de ejecución
  template<class T>
  struct is_execution_policy;
  template<class T>
  constexpr bool is_execution_policy_v = is_execution_policy<T>::value;
}
 
namespace std::execution {
  // política de ejecución secuenciada
  class sequenced_policy;
 
  // política de ejecución paralela
  class parallel_policy;
 
  // política de ejecución paralela y no secuenciada
  class parallel_unsequenced_policy;
 
  // unsequenced execution policy
  class unsequenced_policy;
 
  // objetos de política de ejecución
  inline constexpr sequenced_policy seq{ /* no especificado */ };
  inline constexpr parallel_policy par{ /* no especificado */ };
  inline constexpr parallel_unsequenced_policy par_unseq{ /* no especificado */ };
  inline constexpr unsequenced_policy unseq{ /* no especificado */ };
}
 
namespace std {
  // conceptos auxiliares
  template<class T>
  concept /*valor-movible*/ = /* véase descripción */; // solo de exposición
 
  template<class From, class To>
  concept /*decae-a*/ = same_as<decay_t<From>, To>; // solo de exposición
 
  template<class T>
  concept /*tipo-clase*/ = /*decae-a*/<T, T> && is_class_v<T>; // solo de exposición
 
  // objetos consultables
  template<class T>
  concept /*consultable*/ = /* véase descripción */; // solo de exposición
 
  // consultas
  struct forwarding_query_t
  { /* no especificado */
  };
  struct get_allocator_t
  { /* no especificado */
  };
  struct get_stop_token_t
  { /* no especificado */
  };
 
  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 /*consulta-de-reenvío*/ = forwarding_query(T{}); // solo de exposición
}
 
namespace std::execution {
  // consultas
  struct get_domain_t
  { /* no especificado */
  };
  struct get_scheduler_t
  { /* no especificado */
  };
  struct get_delegation_scheduler_t
  { /* no especificado */
  };
  struct get_forward_progress_guarantee_t
  { /* no especificado */
  };
  template<class CPO>
  struct get_completion_scheduler_t
  { /* no especificado */
  };
 
  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 empty_env
  {};
  struct get_env_t
  { /* no especificado */
  };
  inline constexpr get_env_t get_env{};
 
  template<class T>
  using env_of_t = decltype(get_env(declval<T>()));
 
  // dominios de ejecución
  struct default_domain;
 
  // planificadores
  struct scheduler_t
  {};
 
  template<class Sch>
  concept scheduler = /* véase descripción */;
 
  // receptores
  struct receiver_t
  {};
 
  template<class Rcvr>
  concept receiver = /* véase descripción */;
 
  template<class Rcvr, class Completions>
  concept receiver_of = /* véase descripción */;
 
  struct set_value_t
  { /* no especificado */
  };
  struct set_error_t
  { /* no especificado */
  };
  struct set_stopped_t
  { /* no especificado */
  };
 
  inline constexpr set_value_t set_value{};
  inline constexpr set_error_t set_error{};
  inline constexpr set_stopped_t set_stopped{};
 
  // estados de operación
  struct operation_state_t
  {};
 
  template<class O>
  concept operation_state = /* véase descripción */;
 
  struct start_t;
  inline constexpr start_t start{};
 
  // emisores
  struct sender_t
  {};
 
  template<class Sndr>
  concept sender = /* véase descripción */;
 
  template<class Sndr, class Env = empty_env>
  concept sender_in = /* véase descripción */;
 
  template<class Sndr, class Rcvr>
  concept sender_to = /* véase descripción */;
 
  template<class... Ts>
  struct /*lista-de-tipos*/; // solo de exposición
 
  // signaturas de terminación
  struct get_completion_signatures_t;
  inline constexpr get_completion_signatures_t get_completion_signatures{};
 
  template<class Sndr, class Env = empty_env>
    requires sender_in<Sndr, Env>
  using completion_signatures_of_t =
    /*tipo-resultado-de-llamada*/<get_completion_signatures_t, Sndr, Env>;
 
  template<class... Ts>
  using /*tupla-decaída*/ = tuple<decay_t<Ts>...>; // solo de exposición
 
  template<class... Ts>
  using /*variante-o-vacío*/ = /* véase descripción */; // solo de exposición
 
  template<class Sndr,
           class Env                        = empty_env,
           template<class...> class Tuple   = /*tupla-decaída*/,
           template<class...> class Variant = /*variante-o-vacío*/>
    requires sender_in<Sndr, Env>
  using value_types_of_t = /* véase descripción */;
 
  template<class Sndr,
           class Env                        = empty_env,
           template<class...> class Variant = /*variante-o-vacío*/>
    requires sender_in<Sndr, Env>
  using error_types_of_t = /* véase descripción */;
 
  template<class Sndr, class Env = empty_env>
    requires sender_in<Sndr, Env>
  constexpr bool sends_stopped = /* véase descripción */;
 
  template<class Sndr, class Env>
  using /*tipo-valor-de-emisor-único*/ = /* véase descripción */; // solo de exposición
 
  template<class Sndr, class Env>
  concept /*emisor-único*/ = /* véase descripción */; // solo de exposición
 
  template<sender Sndr>
  using tag_of_t = /* véase descripción */;
 
  // transformaciones de emisores
  template<class Domain, sender Sndr, /*consultable*/... Env>
    requires(sizeof...(Env) <= 1)
  constexpr sender decltype(auto) transform_sender(
    Domain dom,
    Sndr&& sndr,
    const Env&... env) noexcept(/* véase descripción */);
 
  // transformaciones de entorno
  template<class Domain, sender Sndr, /*consultable*/ Env>
  constexpr /*consultable*/ decltype(auto) transform_env(Domain dom,
                                                       Sndr&& sndr,
                                                       Env&& env) noexcept;
 
  // aplicación de algoritmo de emisor
  template<class Domain, class Tag, sender Sndr, class... Args>
  constexpr decltype(auto) apply_sender(Domain dom,
                                        Tag,
                                        Sndr&& sndr,
                                        Args&&... args) noexcept(/* véase descripción */);
 
  // el algoritmo conectar emisor
  struct connect_t;
  inline constexpr connect_t connect{};
 
  template<class Sndr, class Rcvr>
  using connect_result_t = decltype(connect(declval<Sndr>(), declval<Rcvr>()));
 
  // fábricas de emisores
  struct just_t
  { /* no especificado */
  };
  struct just_error_t
  { /* no especificado */
  };
  struct just_stopped_t
  { /* no especificado */
  };
  struct schedule_t
  { /* no especificado */
  };
 
  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 /* no especificado */ read_env{};
 
  template<scheduler Sndr>
  using schedule_result_t = decltype(schedule(declval<Sndr>()));
 
  // adaptadores de emisores
  template</*tipo-clase*/ D>
  struct sender_adaptor_closure
  {};
 
  struct starts_on_t
  { /* no especificado */
  };
  struct continues_on_t
  { /* no especificado */
  };
  struct on_t
  { /* no especificado */
  };
  struct schedule_from_t
  { /* no especificado */
  };
  struct then_t
  { /* no especificado */
  };
  struct upon_error_t
  { /* no especificado */
  };
  struct upon_stopped_t
  { /* no especificado */
  };
  struct let_value_t
  { /* no especificado */
  };
  struct let_error_t
  { /* no especificado */
  };
  struct let_stopped_t
  { /* no especificado */
  };
  struct bulk_t
  { /* no especificado */
  };
  struct split_t
  { /* no especificado */
  };
  struct when_all_t
  { /* no especificado */
  };
  struct when_all_with_variant_t
  { /* no especificado */
  };
  struct into_variant_t
  { /* no especificado */
  };
  struct stopped_as_optional_t
  { /* no especificado */
  };
  struct stopped_as_error_t
  { /* no especificado */
  };
 
  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{};
 
  // servicios de emisores y receptores
 
  template<class Fn>
  concept /*signatura-de-terminación*/ = /* véase descripción */; // solo de exposición
 
  template</*signatura-de-terminación*/... Fns>
  struct completion_signatures
  {};
 
  template<class Sigs>
  concept /*signaturas-de-terminación-válidas*/ = /* véase descripción */; // solo de exposición
 
  template</*signaturas-de-terminación-válidas*/ InputSignatures,
           /*signaturas-de-terminación-válidas*/ AdditionalSignatures = completion_signatures<>,
           template<class...> class SetValue                    = /* véase descripción */,
           template<class> class SetError                       = /* véase descripción */,
           /*signaturas-de-terminación-válidas*/ SetStopped =
             completion_signatures<set_stopped_t()>>
  using transform_completion_signatures = completion_signatures</* véase descripción */>;
 
  template<sender Sndr,
           class Env                                            = empty_env,
           /*signaturas-de-terminación-válidas*/ AdditionalSignatures = completion_signatures<>,
           template<class...> class SetValue                    = /* véase descripción */,
           template<class> class SetError                       = /* véase descripción */,
           /*signaturas-de-terminación-válidas*/ 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>;
 
  // bucle de ejecución
  class run_loop;
}
 
namespace std::this_thread {
  // consumidores
  struct sync_wait_t
  { /* no especificado */
  };
  struct sync_wait_with_variant_t
  { /* no especificado */
  };
 
  inline constexpr sync_wait_t sync_wait{};
  inline constexpr sync_wait_with_variant_t sync_wait_with_variant{};
}
 
namespace std::execution {
  struct as_awaitable_t
  { /* no especificado */
  };
  inline constexpr as_awaitable_t as_awaitable{};
 
  template</*tipo-clase*/ Promise>
  struct with_awaitable_senders;
}

[editar] Conceptos auxiliares

namespace std {
  template<class T>
  concept /*valor-movible*/ = // solo de exposición
    move_constructible<decay_t<T>> && constructible_from<decay_t<T>, T> &&
    (!is_array_v<remove_reference_t<T>>);
}
 
namespace std {
  template<class T>
  concept /*consultable*/ = destructible<T>; // solo de exposición
}
 
namespace std::execution {
  template<class Sndr, class Env>
  concept /*emisor-único*/ = sender_in<Sndr, Env> && requires {
    typename /*tipo-valor-de-emisor-único*/<Sndr, Env>;
  };
}

[editar] Clases auxiliares

namespace std::execution {
  struct /*variante-vació*/
  { // solo de exposición
    /*variante-vació*/() = delete;
  };
}

[editar] enum std::forward_progress_guarantee

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

[editar] Concepto scheduler

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

[editar] Concepto 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)
      } -> /*consultable*/;
    } && move_constructible<remove_cvref_t<Rcvr>> && // r-valores son movibles, y
    constructible_from<remove_cvref_t<Rcvr>, Rcvr>;  // l-valores son copiables
 
  template<class Signature, class Rcvr>
  concept /*terminación-válida-para*/ = requires(Signature* sig) {
    []<class Tag, class... Args>(Tag(*)(Args...))
      requires /*invocable*/<Tag, remove_cvref_t<Rcvr>, Args...>
    {
    }
    (sig);
  };
 
  template<class Rcvr, class Completions>
  concept /*tiene-terminaciones*/ = requires(Completions* completions) {
    []</*terminación-válida-para*/<Rcvr>... Sigs>(completion_signatures<Sigs...>*) {
    }(completions);
  };
 
  template<class Rcvr, class Completions>
  concept receiver_of = receiver<Rcvr> && /*tiene-terminaciones*/<Rcvr, Completions>;
}

[editar] Concepto 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;
    };
}