3#include <experimental/coroutine>
27 {
return this->m_value; }
30template<
typename Type>
41 auto operator co_await()
50template<
typename SemanticReturnType>
55 template<
typename ReturnType>
64 = std::experimental::coroutine_handle<PromiseType>;
68 ReturnType m_return_value;
95 return std::experimental::suspend_always{};
101 return std::experimental::suspend_always{};
111 template<
typename Type>
122 this->m_return_value = value;
128 this->m_return_value = value;
144 m_frame_handle{handle} { }
150 m_frame_handle{rhs.m_frame_handle}
154 rhs.m_frame_handle =
nullptr;
159 if(!this->m_frame_handle)
163 this->m_frame_handle.resume();
165 return !this->m_frame_handle.done();
171 if(this->m_frame_handle)
174 this->m_frame_handle.promise();
176 return promise.m_return_value;
179 throw std::exception{};
184 if(this->m_frame_handle)
186 this->m_frame_handle.destroy();
187 this->m_frame_handle =
nullptr;
214 = std::experimental::coroutine_handle<PromiseType>;
241 return std::experimental::suspend_always{};
247 return std::experimental::suspend_always{};
257 template<
typename Type>
280 m_frame_handle{handle} { }
286 m_frame_handle{rhs.m_frame_handle}
290 rhs.m_frame_handle =
nullptr;
295 if(!this->m_frame_handle)
299 this->m_frame_handle.resume();
301 return !this->m_frame_handle.done();
307 if(this->m_frame_handle)
309 this->m_frame_handle.destroy();
310 this->m_frame_handle =
nullptr;
321template<
typename SemanticReturnType =
void>
auto await_transform(Type &&value)
void unhandled_exception()
void return_value(ReturnType value)
static auto get_return_object_on_allocation_failure()
std::experimental::coroutine_handle< PromiseType > coroutine_frame_type
void yield_value(ReturnType value)
std::experimental::coroutine_handle< PromiseType > coroutine_frame_type
void unhandled_exception()
auto await_transform(Type &&value)
static auto get_return_object_on_allocation_failure()
ResumableType(const ResumableType &)=delete
ResumableType(ResumableType &&rhs)
typename promise_type::coroutine_frame_type coroutine_frame_type
ResumableType(const ResumableType &)=delete
ResumableType(ResumableType &&rhs)
typename promise_type::coroutine_frame_type coroutine_frame_type
bool await_ready() noexcept
void await_suspend(std::experimental::coroutine_handle<>) noexcept
Type await_resume() noexcept