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

Undefined behaviour documentation #22

Closed
hamparawa opened this Issue Apr 20, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@hamparawa
Contributor

hamparawa commented Apr 20, 2018

Hi,
The documentation states that,

Calling coroutine<>::push_type::operator() and coroutine<>::pull_type::operator() from inside the same coroutine results in undefined behaviour.

and provides the following example,

boost::coroutines2::coroutine<void>::push_type coro(
    [&](boost::coroutines2::coroutine<void>::pull_type& yield){
        yield();
});
coro();

Shouldn't this be something like this?

boost::coroutines2::coroutine<void>::push_type coro(
    [&](boost::coroutines2::coroutine<void>::pull_type& yield){
        coro();
});
coro();
@hamparawa

This comment has been minimized.

Contributor

hamparawa commented Apr 20, 2018

#21

@olk

This comment has been minimized.

Member

olk commented Apr 20, 2018

correct, ty

@olk olk closed this Apr 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment