Skip to content

Don't require the promise_contract return type to be a std::pair #120

Description

@dhollman

I think we should specify the promise_contract_t return type in terms of members (currently first and second, but I think we can do better than that) rather than strictly constraining it to be a specialization of std::pair (maybe we haven't said this explicitly yet, but it does feel like this is implied). In the case of the polymorphic return type, this means we'd have to specify a relatively trivial concrete type, but I think that's fine.

One of the main reasons to do this is that I can see us wanting to add traits or other functionality to the return type that don't really belong on the promise part or on the future_token part, and if we have a pair as the means of binding these things together, we're kind of stuck. It's pretty similar to the logic behind providing a passthrough on_value() function in this respect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions