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

std::begin and std::end are not overloaded for coroutine<>::pull_type #31

Closed
robinjam opened this issue May 4, 2020 · 1 comment
Closed

Comments

@robinjam
Copy link

robinjam commented May 4, 2020

The documentation says that std::begin and std::end are overloaded for coroutine<>::pull_type, but the following example code fails to compile on Clang (Xcode 11.4, macOS 10.15.4):

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 = std::begin(my_coro); i != std::end(my_coro); ++i) {
// ^ No matching function for call to 'begin', No matching function for call to 'end'
    std::cout << *i << std::endl;
}

Calling detail::begin and detail::end directly works, and range-based for also works.

I'm not sure if this is a bug, a documentation problem, or a misunderstanding at my end.

@olk
Copy link
Member

olk commented Jul 2, 2020

should be fixed with f3bf547 provide std::begin/std::end overloads for pull_coroutine

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

2 participants