Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持协程迭代器吗? #305

Open
consolexinhun opened this issue Nov 6, 2023 · 0 comments
Open

支持协程迭代器吗? #305

consolexinhun opened this issue Nov 6, 2023 · 0 comments

Comments

@consolexinhun
Copy link

这个支持协程迭代器吗?类似 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;

}

想要一个这样的功能

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant