Commit e77f06df authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook GitHub Bot

Fix coroutine integration with Expected on GCC

Summary: The same logic that was gated for MSVC is applicable to GCC as well (note that it had to be fixed).

Reviewed By: yfeldblum

Differential Revision: D33799604

fbshipit-source-id: 34bd7159c0cc37b5d49d631f715339512bfc4ddd
parent 0d2f150b
......@@ -964,12 +964,10 @@ class Expected final : expected_detail::ExpectedStorage<Value, Error> {
return *this;
}
#ifdef _MSC_VER
// Used only when an Expected is used with coroutines on MSVC
/* implicit */ Expected(const expected_detail::PromiseReturn<Value, Error>& p)
: Expected{} {
p.promise_->value_ = this;
}
#ifndef __clang__
// Used only when an Expected is used with coroutines on MSVC/GCC
/* implicit */ Expected(expected_detail::PromiseReturn<Value, Error>&& p)
: Expected{std::move(*p.storage_)} {}
#endif
template <class... Ts FOLLY_REQUIRES_TRAILING(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment