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.
I think we should specify the
promise_contract_treturn type in terms of members (currentlyfirstandsecond, but I think we can do better than that) rather than strictly constraining it to be a specialization ofstd::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
promisepart or on thefuture_tokenpart, and if we have apairas the means of binding these things together, we're kind of stuck. It's pretty similar to the logic behind providing a passthroughon_value()function in this respect.