Krzysztof Grobelny | f32f6fe | 2020-10-30 13:51:58 +0100 | [diff] [blame] | 1 | #pragma once |
2 | |||||
3 | #include <future> | ||||
4 | |||||
5 | namespace utils | ||||
6 | { | ||||
7 | |||||
8 | template <class T> | ||||
9 | inline void setException(std::promise<T>& promise, const std::string& message) | ||||
10 | { | ||||
11 | promise.set_exception(std::make_exception_ptr(std::runtime_error(message))); | ||||
12 | } | ||||
13 | |||||
14 | } // namespace utils |