coroutine2 icon indicating copy to clipboard operation
coroutine2 copied to clipboard

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

Open kelbon opened this issue 7 months ago • 0 comments

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

kelbon avatar Jun 27 '25 11:06 kelbon