blob: a1a2e57429b3839feb0d080e1214510758edbc99 [file] [log] [blame]
#if __has_include (<coroutine>)
#include <coroutine>
using namespace std;
#elif defined (__clang__) && __has_include (<experimental/coroutine>)
#include <experimental/coroutine>
namespace std { using namespace experimental; }
#endif
struct generator {
struct promise_type {
generator get_return_object();
void return_void();
void unhandled_exception();
suspend_always initial_suspend();
suspend_always final_suspend() noexcept;
template<typename Arg>
suspend_always yield_value(Arg&&) {
return {};
}
};
};
generator x() {
co_yield "foo";
}