Difference between revisions of "cpp/execution/just stopped"
m (fmt.) |
m (~) |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{cpp/execution/title|just_stopped}} | {{cpp/execution/title|just_stopped}} | ||
− | {{ | + | {{cpp/execution/navbar}} |
− | + | {{dcl begin}} | |
+ | {{dcl header|execution}} | ||
+ | {{dcl|since=c++26|notes={{mark custpt}}|1= | ||
+ | inline constexpr just_stopped_t just_stopped{}; | ||
+ | struct just_stopped_t { /*unspecified*/ }; | ||
+ | }} | ||
+ | {{dcl h|Call signature}} | ||
+ | {{dcl|since=c++26|1= | ||
execution::sender auto just_stopped(); | execution::sender auto just_stopped(); | ||
}} | }} | ||
+ | {{dcl end}} | ||
+ | |||
+ | A sender factory that returns a sender which completes immediately by calling the receiver’s {{rlpf|set_stopped}}. | ||
+ | |||
+ | The expression {{c|just_stopped()}} is [[cpp/language/expressions#Expression-equivalence|expression-equivalent]] to {{c|/*make-sender*/(just_stopped)}} | ||
+ | |||
+ | {{cpp/execution/cpo}} | ||
− | === | + | ===Example=== |
− | + | {{example}} | |
− | + | {{langlinks|de|es|ja|ru|zh}} | |
− | + |
Latest revision as of 16:27, 4 October 2024
Defined in header <execution>
|
||
inline constexpr just_stopped_t just_stopped{}; struct just_stopped_t { /*unspecified*/ }; |
(since C++26) (customization point object) |
|
Call signature |
||
execution::sender auto just_stopped(); |
(since C++26) | |
A sender factory that returns a sender which completes immediately by calling the receiver’s set_stopped()
.
The expression just_stopped() is expression-equivalent to /*make-sender*/(just_stopped)
Customization point objects
The name execution::just_stopped
denotes a customization point object, which is a const function object of a literal semiregular
class type. The cv-unqualified version of its type is a tag type denoted as execution::just_stopped_t
.
All instances of execution::just_stopped_t
are equal. The effects of invoking different instances of type execution::just_stopped_t
on the same arguments are equivalent, regardless of whether the expression denoting the instance is an lvalue or rvalue, and is const-qualified or not (however, a volatile-qualified instance is not required to be invocable). Thus, execution::just_stopped
can be copied freely and its copies can be used interchangeably.
Given a set of types Args...
, if std::declval<Args>()... meet the requirements for arguments to execution::just_stopped
above, execution::just_stopped_t
models
- std::invocable<execution::just_stopped_t, Args...>,
- std::invocable<const execution::just_stopped_t, Args...>,
- std::invocable<execution::just_stopped_t&, Args...>, and
- std::invocable<const execution::just_stopped_t&, Args...>.
Otherwise, no function call operator of execution::just_stopped_t
participates in overload resolution.
[edit] Example
This section is incomplete Reason: no example |