bool* done = nullptr;
};
-
template<typename... Ts>
class blocked_result
{
using return_type = std::tuple<Ts...>;
explicit blocked_result(completion_handler_type& h) noexcept {
+ std::scoped_lock l(m);
out_ec = h.ec;
if (!out_ec) h.ec = &ec;
h.value = &value;
return std::move(*value);
}
+ blocked_result(const blocked_result&) = delete;
+ blocked_result& operator =(const blocked_result&) = delete;
+ blocked_result(blocked_result&&) = delete;
+ blocked_result& operator =(blocked_result&&) = delete;
+
private:
bs::error_code* out_ec;
bs::error_code ec;
using return_type = T;
explicit blocked_result(completion_handler_type& h) noexcept {
+ std::scoped_lock l(m);
out_ec = h.ec;
if (!out_ec) h.ec = &ec;
h.value = &value;
return std::move(*value);
}
+ blocked_result(const blocked_result&) = delete;
+ blocked_result& operator =(const blocked_result&) = delete;
+ blocked_result(blocked_result&&) = delete;
+ blocked_result& operator =(blocked_result&&) = delete;
+
private:
bs::error_code* out_ec;
bs::error_code ec;
using return_type = void;
explicit blocked_result(completion_handler_type& h) noexcept {
+ std::scoped_lock l(m);
out_ec = h.ec;
if (!out_ec) h.ec = &ec;
h.m = &m;
if (!out_ec && ec) throw bs::system_error(ec);
}
+ blocked_result(const blocked_result&) = delete;
+ blocked_result& operator =(const blocked_result&) = delete;
+ blocked_result(blocked_result&&) = delete;
+ blocked_result& operator =(blocked_result&&) = delete;
+
private:
bs::error_code* out_ec;
bs::error_code ec;