Introduce makePromiseContract
Summary: [Folly] Introduce makePromiseContract, for producing a paired promise-and-semi-future or a paired promise-and-future, depending on which overload is invoked. It is not ideal that a future is gotten from a promise, but only once. Rather, it is ideal that they be created together. C++17 code may use structured bindings: ```lang=c++ auto [p, f] = makePromiseContract(); // promise with semi-future auto [p, f] = makePromiseContract(&e); // promise with future, given executor e ``` Reviewed By: LeeHowes Differential Revision: D7984050 fbshipit-source-id: 52ee5624fde7c48aa0e81243564ad067c6c6919f
Showing
Please register or sign in to comment