Document Number: P0912R1
Date: 2018-05-05
Audience: WG21
Reply to: gorn@microsoft.com

Merge Coroutines TS into C++20 working draft

Abstract

This paper proposes merging Working Draft of Coroutines TS [N4736] into the C++20 working draft [N4741].

Revision history

r0: initial revision

r1:

Introduction

Coroutines address the dire need by dramatically simplifying development of asynchronous code. Coroutines have been available and in use for 4 years. We have implementations from two major compiler vendors. It is time to merge Coroutines TS to the working paper.

Wording

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.

Effect on original feature: The following C++ headers are new: <compare>, <coroutine>, and <syncstream>. Valid C++ 2017 code that #includes headers with these names may be invalid in this International Standard.