Skip to content

Incorrect documentation for pull_type::operator= in Boost.Coroutine2 #54

Description

@kelbon

The documentation for pull_type::operator= in Boost.Coroutine2 is currently misleading. It states:

Effects: Destroys the internal data of *this and moves the internal data of other to *this. other becomes not-a-coroutine.

Real code:

    pull_coroutine & operator=( pull_coroutine && other) noexcept {
        std::swap( cb_, other.cb_);
        return * this;
    }

Additionally, the absence of a .swap() member function in pull_type might lead to incorrect assumptions—particularly that

using std::swap;
swap(a, b);

would invalidate both coroutines, which is not the case.

Doc:

https://www.boost.org/doc/libs/1_78_0/libs/coroutine2/doc/html/coroutine2/coroutine/asymmetric/pull_coro.html

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions