[Question] Should single-argument sender adaptors be sender adaptor closure objects?

Offen
#2,400 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
25/100
Issue-Typ
Dokumentation
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cpp
Bereich
api, documentation

Rechercherichtung

The question is about the wording of the C++ draft standard paragraph exec.adapt.obj#4, which says single-argument pipeable sender adaptors are closure objects. Compare it with the range adaptor closure wording in the standard and check how stdexec's single-argument sender adaptors are used with and without parentheses. This needs a decision from the maintainers in the thread, not a patch. Done means the maintainers confirm the intended syntax, and any wording fix they agree on is proposed.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Hi @ericniebler,

I have a question regarding sender adaptors: are single-argument sender adaptors intended to be sender adaptor closure objects?

According to exec.adapt.obj#4 in the current draft standard:

"If a pipeable sender adaptor object accepts only one argument, then it is a pipeable sender adaptor closure object."

If I understand correctly, this implies that single-argument sender adaptors like into_variant, affine, and stopped_as_optional should be piped as sndr | into_variant rather than sndr | into_variant().

In std::ranges, single-argument range adaptors (such as views::all or views::keys) are indeed range adaptor closure objects, piped like rng | views::all. Was this design deliberately adopted for sender adaptors as well, or was this paragraph inadvertently copy-pasted from the range adaptor wording? In other words, is sndr | adaptor intended here, or is this a wording defect and it should have been sndr | adaptor()?

Vorherrschende Sprache
C++
Sterne
2.5k
Forks
284
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
85

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus NVIDIA/stdexec

Alle Issues in NVIDIA/stdexec

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.