Skip to content

Sending multiple values from then #133

Open
@ericniebler

Description

@ericniebler

Issue by brycelelbach
Wednesday Oct 20, 2021 at 16:04 GMT
Originally opened as NVIDIA/stdexec#218


I'd like to have a way to have the result of a function passed to then sent as multiple values. I've come across the need for this multiple times.

E.g. I want to be able to do something like this:

  then([] (T t) { return some_magic{t, U{}}; })
| then([] (T t, U u) { /* ... */ })

Today, I instead have to write something like:

  then([] (T t) { return std::tuple{t, U{}}; })
| then([] (std::tuple<T, U> t) { auto [t, u] = t; /* ... */ })

which I find quite inelegant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2discussionWe need to talk about this; there's nothing actionable here yetenhancementNew feature or requestneeds-paperNeeds a paper to be written

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions