这个支持协程迭代器吗?类似 boost 的 coroutine 的协程迭代器
void foo2(boost::coroutines2::coroutine<int>::pull_type & sink) {
for (auto val : sink) {
std::cout << "retrieve " << val << "\n";
}
}
int main(){
boost::coroutines2::coroutine<int>::push_type source(foo);
for (int i = 0; i < 10; i++) {
source(i);
}
return 0;
}
想要一个这样的功能
这个支持协程迭代器吗?类似 boost 的 coroutine 的协程迭代器
想要一个这样的功能