| 1466 | // Future since the compiler can't properly infer otherwise. |
| 1467 | template <typename T, typename X> |
| 1468 | void thenf(lambda::CallableOnce<Future<X>(const T&)>&& f, |
| 1469 | std::unique_ptr<Promise<X>> promise, |
| 1470 | const Future<T>& future) |
| 1471 | { |
| 1472 | if (future.isReady()) { |
| 1473 | if (future.hasDiscard()) { |
| 1474 | promise->discard(); |
| 1475 | } else { |
| 1476 | promise->associate(std::move(f)(future.get())); |
| 1477 | } |
| 1478 | } else if (future.isFailed()) { |
| 1479 | promise->fail(future.failure()); |
| 1480 | } else if (future.isDiscarded()) { |
| 1481 | promise->discard(); |
| 1482 | } |
| 1483 | } |
| 1484 | |
| 1485 | |
| 1486 | template <typename T, typename X> |
nothing calls this directly
no test coverage detected