| Document Number: | P0912R0 | | -----------------|-------------------------------------------------| | Date: | 2018-02-06 | | Audience: | WG21 | | Reply to: | gorn@microsoft.com | Merge Coroutines TS into C++20 working draft ============================================ ## Abstract This paper proposes merging Coroutines TS [N4723] into the C++20 working draft. ## Introduction * We have two publicly available implementations of coroutines TS in MSVC since version 2015 SP2 (2016) and clang version 5 (2017). * We have an independent coroutine implementation in EDG frontend (2015). * Coroutines were used in production since 2016 on Windows/MSVC and linux/clang (using private branch before the code landed in clang 5.0). * There is an extensive open source coroutine library cppcoro that utilizes most of the coroutine features with tests that can be used to smoke test emerging coroutine implementation for completeness and correction. It is time to merge Coroutines TS to the working paper to unblock development related libraries utilizing coroutine language facilities. ## Wording - Apply rebased coroutine wording as in P0057R8 with the following changes: - replace `experimental::` with nothing - replace `` with `` - in synopsis in [coroutine.trivial.awaitables] and [support.coroutine] - remove "namespace experimental {" and "} // namespace experimental" - remove "inline namespace coroutines_v1 {" and "} // namespace coroutines_v1" - If adopted apply changes from P0913R0 and P0914R0 with clause and subclause numbers updated as described in P0911R0 - Add underlined text to rationale in [diff.cpp17.lex]: > **Rationale:** Required for new features. The `requires` keyword is added to introduce constraints through a _requires-clause_ or a _requires-expression_. The `concept` keyword is added to enable the definition of concepts (17.6.8). The `co_await`, `co_yield`, and `co_return` keywords were added to enable the definition of coroutines (11.4.4). Effect on original feature: Valid ISO C++ 2017 code using `concept`, `co_await`, `co_yield`, `co_return`, or `requires` as an identifier is not valid in this International Standard. - Add underlined text to "Effect on original feature" in [diff.cpp17.library]: > **Effect on original feature:** The following C++ headers are new: ``, ``, and ``. Valid C++ 2017 code that #includes headers with these names may be invalid in this International Standard.