3#include <experimental/coroutine>
53template<
typename SemanticReturnType>
class PromiseType;
55template<
typename SemanticReturnType>
66 = std::experimental::coroutine_handle<PromiseType>;
71 SemanticReturnType m_semantic_return_value;
100 return std::experimental::suspend_always{};
106 return std::experimental::suspend_always{};
113 this->m_semantic_return_value = value;
115 return std::experimental::suspend_always{};
122 this->m_semantic_return_value = value;
124 return std::experimental::suspend_always{};
129template<
typename SemanticReturnType>
145 = std::experimental::coroutine_handle<promise_type>;
154 m_promise_handle{handle} { }
164 this->m_promise_handle = rhs.m_promise_handle;
167 rhs.m_promise_handle =
nullptr;
174 this->m_promise_handle.promise();
176 return promise.m_semantic_return_value;
184 if(this->m_promise_handle)
186 this->m_promise_handle.resume();
188 return !this->m_promise_handle.done();
202 if(this->m_promise_handle)
203 this->m_promise_handle.destroy();
static auto get_return_object_on_allocation_failure()
auto return_value(SemanticReturnType value)
void unhandled_exception()
friend class ResumableType
std::experimental::coroutine_handle< PromiseType > promise_handle_type
auto yield_value(SemanticReturnType value)
SemanticReturnType next()
ResumableType(const ResumableType &)=delete
ResumableType(ResumableType &&rhs)
std::experimental::coroutine_handle< promise_type > promise_handle_type