1
0
Fork 0
mirror of https://gitlab.com/niansa/libcrosscoro.git synced 2025-03-06 20:53:32 +01:00
libcrosscoro/inc/coro/concepts/executor.hpp
2021-07-28 12:09:16 +02:00

24 lines
432 B
C++

#pragma once
#include "coro/concepts/awaitable.hpp"
#include <concepts>
#include <coroutine>
namespace coro::concepts
{
template<typename type>
concept executor = requires(type t, std::coroutine_handle<> c)
{
{
t.schedule()
} -> coro::concepts::awaiter;
{
t.yield()
} -> coro::concepts::awaiter;
{
t.resume(c)
} -> std::same_as<void>;
};
} // namespace coro::concepts