In a coroutine function, we can add auto ex = co_await asio::this_coro::executor; to get the executor of this coroutine. But when I want to learn the definition of it, I found this:
/// Awaitable type that returns the executor of the current coroutine.
struct executor_t
{
ASIO_CONSTEXPR executor_t()// ASIO_CONSTEXPR is defined constexpr
{
}
};
/// Awaitable object that returns the executor of the current coroutine.
#if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
constexpr executor_t executor;
#elif defined(ASIO_MSVC)
__declspec(selectany) executor_t executor;
#endif
Why does executor awiatable?