Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/execution/stopped as optional"

From cppreference.com
< cpp‎ | execution
(move to cpp/experimental)
m (Reverted edits by Cooky (talk) to last revision by Space Mission)
Line 1: Line 1:
 +
{{cpp/execution/title|stopped_as_optional}}
 +
{{cpp/experimental/execution/navbar}}
  
 +
{{ddcl|header=execution|since=c++26|
 +
execution::sender auto stopped_as_optional(
 +
    single-sender auto snd
 +
);
 +
}}
 +
 +
===Parameters===
 +
{{par begin}}
 +
{{par|snd|input sender of which the value channel and stopped channel are mapped.}}
 +
{{par end}}
 +
 +
===Return value===
 +
Returns a sender that maps the value channel from a {{tt|T}} to an {{c|std::optional<std::decay_t<T>>}}, and maps the stopped channel to a value of an empty {{c|std::optional<std::decay_t<T>>}}.

Revision as of 13:06, 3 October 2024

Defined in header <execution>
execution::sender auto stopped_as_optional(

    single-sender auto snd

);
(since C++26)

Parameters

snd - input sender of which the value channel and stopped channel are mapped.

Return value

Returns a sender that maps the value channel from a T to an std::optional<std::decay_t<T>>, and maps the stopped channel to a value of an empty std::optional<std::decay_t<T>>.