boostorg / boostorg/coroutine2

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

Open
#54 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
140
Forks
44
PR merge metrics
No merged PRs in 30d

Description

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:

```cpp
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
```cpp

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.