Skip to content

Sending multiple values from then #218

Closed
@brycelelbach

Description

@brycelelbach

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 requestfollow-on-paperstandardizationissues related to the std::execution proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions