7void division(std::promise<int>& promise,
int a,
int b)
18 promise.set_value(a / b);
23 promise.set_exception( std::current_exception() );
50 std::promise<return_t> promise;
56 auto future = promise.get_future();
64 std::promise<return_t> failed_promise;
65 auto failed_future = failed_promise.get_future();
68 failed_thread.detach();
74 stream <<
"8 / 0 = " << failed_future.get() <<
endl;
76 catch(
const std::exception& e)
reference_wrapper< Type > ref(Type &val) noexcept
void division(std::promise< int > &promise, int a, int b)
void examples_for_promise_future()
Stream output operators << are implemented.
#define Tpf_ThrowDebugException(debug_message)
Throw a debug_exception with message as argument.