Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | execution
m (Reverted edits by Cooky (talk) to last revision by Space Mission)
m (fmt.)
 
Line 1: Line 1:
 
{{cpp/execution/title|stopped_as_error}}
 
{{cpp/execution/title|stopped_as_error}}
{{cpp/experimental/execution/navbar}}
+
{{cpp/execution/navbar}}
 
{{ddcl|header=execution|since=c++26|
 
{{ddcl|header=execution|since=c++26|
template<move_constructible Error>
+
template< std::move_constructible Error >
execution::sender auto stopped_as_error(
+
execution::sender auto stopped_as_error( execution::sender auto snd, Error err );
    execution::sender auto snd,
+
    Error err
+
);
+
 
}}
 
}}
  
Line 17: Line 14:
 
===Return value===
 
===Return value===
 
Returns a sender that maps the stopped channel to an error of {{c|err}}.
 
Returns a sender that maps the stopped channel to an error of {{c|err}}.
 +
 +
===Example===
 +
{{example}}
 +
 +
{{langlinks|de|es|ja|ru|zh}}

Latest revision as of 10:29, 4 October 2024

 
 
 
Defined in header <execution>
template< std::move_constructible Error >
execution::sender auto stopped_as_error( execution::sender auto snd, Error err );
(since C++26)

[edit] Parameters

snd - input sender of which the stopped channel is mapped into err
err - error to which the stop channel is mapped into

[edit] Return value

Returns a sender that maps the stopped channel to an error of err.

[edit] Example