46 template <
class callable,
class... arguments>
47 timeout(
int timeout_ms,
bool async, callable&& f, arguments&&... args)
49 std::function<
typename std::result_of<callable(arguments...)>::type()>
50 task(std::bind(std::forward<callable>(f), std::forward<arguments>(args)...));
55 std::thread([timeout_ms, task]() {
56 std::this_thread::sleep_for(std::chrono::milliseconds(timeout_ms));
63 std::this_thread::sleep_for(std::chrono::milliseconds(timeout_ms));