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

ambiguous call to begin end for coroutine<>::pull_type breaks range-based for (C++17 mode) #42

Closed
hp-peti opened this issue Aug 10, 2021 · 0 comments · Fixed by #43
Closed

Comments

@hp-peti
Copy link
Contributor

hp-peti commented Aug 10, 2021

see #31

the change introduced now doesn't allow

using namespace boost::coroutines2;

auto my_coro = coroutine<int>::pull_type{
    [](coroutine<int>::push_type& yield) {
        for (int i = 0; i < 5; ++i) {
            yield(i);
        }
    }
};

for (auto i : my_coro) {
                 // ^ ambiguous call to 'begin', ambiguous call to 'end'
    std::cout << i << std::endl;
}

tested with gcc 10.3.0, using --std=c++17; and msvc also using c++17 mode

using boost 1.76.0

see also #39

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

Successfully merging a pull request may close this issue.

1 participant