blob: 6680af0201e28e809fbaf1f20893934ef8654da8 [file] [log] [blame]
Krzysztof Grobelnyf32f6fe2020-10-30 13:51:58 +01001#pragma once
2
3#include <future>
4
5namespace utils
6{
7
8template <class T>
9inline 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