Files
cppdraft_translate/cppdraft/exec/just.md
2025-10-25 03:02:53 +03:00

54 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[exec.just]
# 33 Execution control library [[exec]](./#exec)
## 33.9 Senders [[exec.snd]](exec.snd#exec.just)
### 33.9.11 Sender factories [[exec.factories]](exec.factories#exec.just)
#### 33.9.11.2 execution::just, execution::just_error, execution::just_stopped [exec.just]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L2901)
just, just_error, and just_stopped are sender factories
whose asynchronous operations complete synchronously in their start operation
with a value completion operation,
an error completion operation, or
a stopped completion operation, respectively[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L2908)
The names just, just_error, and just_stopped denote
customization point objects[.](#2.sentence-1)
Let *just-cpo* be one ofjust, just_error, or just_stopped[.](#2.sentence-2)
For a pack of subexpressions ts,
let Ts be the pack of types decltype((ts))[.](#2.sentence-3)
The expression *just-cpo*(ts...) is ill-formed if
- [(2.1)](#2.1)
([*movable-value*](exec.general#concept:movable-value "33.1General[exec.general]")<Ts> &&...) is false, or
- [(2.2)](#2.2)
*just-cpo* is just_error andsizeof...(ts) == 1 is false, or
- [(2.3)](#2.3)
*just-cpo* is just_stopped andsizeof...(ts) == 0 is false[.](#2.sentence-4)
Otherwise, it is expression-equivalent to*make-sender*(*just-cpo*, *product-type*{ts...})[.](#2.sentence-5)
For just, just_error, and just_stopped,
let *set-cpo* beset_value, set_error, and set_stopped, respectively[.](#2.sentence-6)
The exposition-only class template *impls-for* ([[exec.snd.expos]](exec.snd.expos "33.9.2Exposition-only entities"))
is specialized for *just-cpo* as follows:namespace std::execution {template<>struct *impls-for*<*decayed-typeof*<*just-cpo*>> : *default-impls* {static constexpr auto *start* =[](auto& state, auto& rcvr) noexcept -> void {auto& [...ts] = state; *set-cpo*(std::move(rcvr), std::move(ts)...); }; };}