void asyncFun(std::promise intPromise){ int result; try { // calculate the result intPromise.set_value(result); } catch (MyException e) { intPromise.set_exception(std::copy_exception(e)); } } std::promise intPromise; std::unique_future intFuture = intPromise.get_future(); std::thread t(asyncFun, std::move(intPromise)); // do some other stuff int result = intFuture.get(); // may throw MyException