| 1504 | |
| 1505 | template <typename T> |
| 1506 | void repair( |
| 1507 | lambda::CallableOnce<Future<T>(const Future<T>&)>&& f, |
| 1508 | std::unique_ptr<Promise<T>> promise, |
| 1509 | const Future<T>& future) |
| 1510 | { |
| 1511 | CHECK(!future.isPending()); |
| 1512 | if (future.isFailed()) { |
| 1513 | promise->associate(std::move(f)(future)); |
| 1514 | } else { |
| 1515 | promise->associate(future); |
| 1516 | } |
| 1517 | } |
| 1518 | |
| 1519 | |
| 1520 | template <typename T> |