This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
[exec.adapt.general]
# 33 Execution control library [[exec]](./#exec)
## 33.9 Senders [[exec.snd]](exec.snd#exec.adapt.general)
### 33.9.12 Sender adaptors [[exec.adapt]](exec.adapt#general)
#### 33.9.12.1 General [exec.adapt.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3002)
Subclause [[exec.adapt]](exec.adapt "33.9.12Sender adaptors") specifies a set of sender adaptors[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3005)
The bitwise inclusive or operator is overloaded
for the purpose of creating sender chains[.](#2.sentence-1)
The adaptors also support function call syntax with equivalent semantics[.](#2.sentence-2)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3010)
Unless otherwise specified:
- [(3.1)](#3.1)
A sender adaptor is prohibited from causing observable effects,
apart from moving and copying its arguments,
before the returned sender is connected with a receiver using connect,
and start is called on the resulting operation state[.](#3.1.sentence-1)
- [(3.2)](#3.2)
A parent sender ([[exec.async.ops]](exec.async.ops "33.3Asynchronous operations")) with a single child sender sndr has
an associated attribute object equal to*FWD-ENV*(get_env(sndr)) ([[exec.fwd.env]](exec.fwd.env "33.5.1forwarding_­query"))[.](#3.2.sentence-1)
- [(3.3)](#3.3)
A parent sender with more than one child sender has
an associated attributes object equal to env<>{}[.](#3.3.sentence-1)
- [(3.4)](#3.4)
When a parent sender is connected to a receiver rcvr,
any receiver used to connect a child sender has
an associated environment equal to *FWD-ENV*(get_env(rcvr))[.](#3.4.sentence-1)
- [(3.5)](#3.5)
An adaptor whose child senders are all non-dependent ([[exec.async.ops]](exec.async.ops "33.3Asynchronous operations"))
is itself non-dependent[.](#3.5.sentence-1)
- [(3.6)](#3.6)
These requirements apply to any function
that is selected by the implementation of the sender adaptor[.](#3.6.sentence-1)
- [(3.7)](#3.7)
*Recommended practice*: Implementations should use
the completion signatures of the adaptors
to communicate type errors to users and
to propagate any such type errors from child senders[.](#3.7.sentence-1)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3043)
If a sender returned from a sender adaptor specified in [[exec.adapt]](exec.adapt "33.9.12Sender adaptors") is specified to include set_error_t(Err) among its set of completion signatures
where decay_t<Err> denotes the type exception_ptr,
but the implementation does not potentially evaluate
an error completion operation with an exception_ptr argument,
the implementation is allowed to omit
the exception_ptr error completion signature from the set[.](#4.sentence-1)

112
cppdraft/exec/adapt/obj.md Normal file
View File

@@ -0,0 +1,112 @@
[exec.adapt.obj]
# 33 Execution control library [[exec]](./#exec)
## 33.9 Senders [[exec.snd]](exec.snd#exec.adapt.obj)
### 33.9.12 Sender adaptors [[exec.adapt]](exec.adapt#obj)
#### 33.9.12.2 Closure objects [exec.adapt.obj]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3055)
A [*pipeable sender adaptor closure object*](#def:sender_adaptor_closure_object,pipeable "33.9.12.2Closure objects[exec.adapt.obj]") is a function object
that accepts one or more [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]") arguments and returns a [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]")[.](#1.sentence-1)
For a pipeable sender adaptor closure object c and
an expression sndr such that decltype((sndr)) models [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]"),
the following expressions are equivalent and yield a [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]"):c(sndr) sndr | c
Given an additional pipeable sender adaptor closure object d,
the expression c | d produces
another pipeable sender adaptor closure object e:
e is a perfect forwarding call wrapper ([[func.require]](func.require "22.10.4Requirements"))
with the following properties:
- [(1.1)](#1.1)
Its target object is an object d2 of type decltype(auto(d)) direct-non-list-initialized with d[.](#1.1.sentence-1)
- [(1.2)](#1.2)
It has one bound argument entity,
an object c2 of type decltype(auto(c)) direct-non-list-initialized with c[.](#1.2.sentence-1)
- [(1.3)](#1.3)
Its call pattern is d2(c2(arg)),
where arg is the argument used in a function call expression of e[.](#1.3.sentence-1)
The expression c | d is well-formed if and only if
the initializations of the state entities ([[func.def]](func.def "22.10.3Definitions")) of e are all well-formed[.](#1.sentence-5)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3088)
An object t of type T is
a pipeable sender adaptor closure object
if T models [derived_from](concept.derived#concept:derived_from "18.4.3Concept derived_­from[concept.derived]")<sender_adaptor_closure<T>>,T has no other base classes
of type sender_adaptor_closure<U> for any other type U, andT does not satisfy [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]")[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3096)
The template parameter D for sender_adaptor_closure can be
an incomplete type[.](#3.sentence-1)
Before any expression of type cv D appears as
an operand to the | operator,D shall be complete and
model [derived_from](concept.derived#concept:derived_from "18.4.3Concept derived_­from[concept.derived]")<sender_adaptor_closure<D>>[.](#3.sentence-2)
The behavior of an expression involving an object of type cv D as an operand to the | operator is undefined
if overload resolution selects a program-defined operator| function[.](#3.sentence-3)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3107)
A [*pipeable sender adaptor object*](#def:sender_adaptor_object,pipeable "33.9.12.2Closure objects[exec.adapt.obj]") is a customization point object
that accepts a [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]") as its first argument and
returns a [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]")[.](#4.sentence-1)
If a pipeable sender adaptor object accepts only one argument,
then it is a pipeable sender adaptor closure object[.](#4.sentence-2)
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L3114)
If a pipeable sender adaptor object adaptor accepts more than one argument,
then let sndr be an expression
such that decltype((sndr)) models [sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]"),
let args... be arguments
such that adaptor(sndr, args...) is a well-formed expression
as specified below, and
let BoundArgs be a pack that denotes decltype(auto(args))...[.](#5.sentence-1)
The expression adaptor(args...) produces
a pipeable sender adaptor closure object f that is a perfect forwarding call wrapper with the following properties:
- [(5.1)](#5.1)
Its target object is a copy of adaptor[.](#5.1.sentence-1)
- [(5.2)](#5.2)
Its bound argument entities bound_args consist of
objects of types BoundArgs... direct-non-list-initialized withstd::forward<decltype((args))>(args)..., respectively[.](#5.2.sentence-1)
- [(5.3)](#5.3)
Its call pattern is adaptor(rcvr, bound_args...),
where rcvr is
the argument used in a function call expression of f[.](#5.3.sentence-1)
The expression adaptor(args...) is well-formed if and only if
the initializations of the bound argument entities of the result,
as specified above, are all well-formed[.](#5.sentence-3)