mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2024-11-22 19:00:05 +08:00
ce3ed72dd4
Make sure that the promise state can only be changed by the promise producer (and not consumers) by removing the `fulfill` and `reject` methods from the instance members and introducing a new constructor accepting a resolver lambda. That also means that a promise can't anymore be default constructed. Add the static `QPromise<T>::resolve` and `QPromise<T>::reject` methods to create synchronously fulfilled or rejected promises, and fix the `qPromise` helper to handle deduced promises (e.g. `qPromise(QFuture<int>()) -> QPromise<int>`). |
||
---|---|---|
.. | ||
qpromise.pro | ||
tst_qpromise.cpp |