| 491 | |
| 492 | template <typename T, typename F> |
| 493 | inline void SetValue(TPromise<T>& promise, F&& func) { |
| 494 | try { |
| 495 | SetValueImpl(promise, func()); |
| 496 | } catch (...) { |
| 497 | const bool success = promise.TrySetException(std::current_exception()); |
| 498 | if (Y_UNLIKELY(!success)) { |
| 499 | throw; |
| 500 | } |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | template <typename F> |
| 505 | inline void SetValue(TPromise<void>& promise, F&& func, |
no test coverage detected