42 std::exception_ptr GetException()
const noexcept;
46 std::optional<T> value_;
47 std::exception_ptr exception_;
54class ResultStore<
void>
final {
69 std::exception_ptr GetException()
const noexcept;
72 bool has_value_{
false};
73 std::exception_ptr exception_;
79 return std::move(*value_);
82 std::rethrow_exception(exception_);
84 throw std::logic_error(
"result store is not ready");
88const T& ResultStore<T>::
Get()
const& USERVER_IMPL_LIFETIME_BOUND {
93 std::rethrow_exception(exception_);
95 throw std::logic_error(
"result store is not ready");
105 value_.emplace(std::move(value));
109void ResultStore<T>::
SetException(std::exception_ptr&& exception)
noexcept {
110 exception_ = std::move(exception);
114std::exception_ptr ResultStore<T>::GetException()
const noexcept {
119inline void ResultStore<
void>::
Retrieve() { Get(); }
121inline void ResultStore<
void>::Get()
const& {
126 std::rethrow_exception(exception_);
128 throw std::logic_error(
"result store is not ready");
131inline void ResultStore<
void>::
SetValue()
noexcept { has_value_ =
true; }
133inline void ResultStore<
void>::
SetException(std::exception_ptr&& exception)
noexcept {
134 exception_ = std::move(exception);
137inline std::exception_ptr ResultStore<
void>::GetException()
const noexcept {
return exception_; }