我有一个有很多静态方法的类,里面有龙卷风协同装饰器。@staticmethod @gen.coroutine def dosomething1(): # if it is used without gen.coroutine.据我所知,龙卷风使用的raise Return(...)方法可能是基于异常,也许它以某种方式阻止了其他装饰者的尝试.那么,
std::coroutine_handle是C++20新协同机制的重要组成部分。例如,生成器通常(总是?)使用它。在我见过的所有示例中,coroutine的析构函数中手动销毁了句柄: // Other stuff...std::coroutine_handle<promise_type> ch;
if (ch) ch.destroy();}