| 794 | |
| 795 | template <typename T> |
| 796 | Promise<T>::~Promise() |
| 797 | { |
| 798 | // Note that we don't discard the promise as we don't want to give |
| 799 | // the illusion that any computation hasn't started (or possibly |
| 800 | // finished) in the event that computation is "visible" by other |
| 801 | // means. However, we try and abandon the future if it hasn't been |
| 802 | // associated or set (or moved, i.e., `f.data` is true). |
| 803 | if (f.data) { |
| 804 | f.abandon(); |
| 805 | } |
| 806 | } |
| 807 | |
| 808 | |
| 809 | template <typename T> |