943 words
5 minutes
How are my WG21 proposals doing?
2022-07-07
2026-08-03

I have written several proposals for the ISO C++ committee (WG21). They are all written in Bikeshed so that automatic proposal referencing can be used, and the resulting proposal looks nicer. All proposal source code are stored in the wg21-papers repo.

P2549: std::unexpected<E> should have error() as member accessor#

  • Audience: LWG
  • Target: C++23
  • Revisions: R0, R1
  • Current Status: Approved for C++23

This is my first ever proposal to WG21. It is a simple renaming proposal, proposing to fix an inconsistency in the std::expected paper, such that std::expected::value() returns the normal value but std::unexpected::value() actually returns the error (abnormal) value.

History:

  • 2022-07-25: R1 approved for inclusion in C++23 in the 2022-07-25 WG21 plenary. (Plenary -> Approved)
  • 2022-07-08: R1 seen by LWG, approved for plenary. (Stage 3 -> Plenary)
  • 2022-06-22: R0 passed 2022-05 LEWG Electronic Poll. (EP -> Stage 3)
  • 2022-06-20: P2549R1 shipped in the 2022-07 Mailing.
  • 2022-03-01: R0 seen by LEWG, approved for EP. (Stage 2 -> EP)
  • 2022-02-13: P2549R0 shipped in the 2022-02 Mailing.

P2573: = delete("should have a reason");#

  • Audience: CWG
  • Target: C++26
  • Revisions: R0, R1, R2
  • Current Status: Approved for C++26

C++20 added [[nodiscard("with reason")]], together with [[deprecated]] and static_assert, forming the group of “diagnostic with reason” constructs in C++. = delete functions often have a reason to delete themselves (alternative exist, prevent rvalue dangling, etc), so this proposal proposed adding a reason clause to it too.

History:

  • 2024-04-15: P2573R2 shipped in the 2024-04 post-Tokyo Mailing.
  • 2024-03-23: R2 approved for inclusion in C++26 in the Tokyo (2024-03) WG21 plenary. (Plenary -> Approved)
  • 2024-03-22: R2 seen by CWG in Tokyo (2024-03), approved for plenary. (Stage 3 -> Plenary)
  • 2024-03-19: R1 seen by EWG in Tokyo (2024-03), approved for CWG. (Stage 2 -> Stage 3)
  • 2023-12-15: P2573R1 shipped in the 2023-12 post-Kona Mailing.
  • 2023-11-06: Backtrack to Stage 1, then D2573R1 seen by EWGI in Kona (2023-11), approved for EWG. (Stage 2 -> Stage 1 -> Stage 2)
  • 2022-04-12: P2573R0 shipped in the 2022-04 Mailing.

P2613: Add the missing empty() to mdspan#

  • Audience: LEWG, LWG
  • Target: C++23
  • Revisions: R0, R1
  • Current Status: Approved for C++23

This is a very rushed paper. In mid-June, I spotted a bunch of problems with the about-to-be-approved mdspan paper, and opened a PR, wanting to add noexcept to some member functions, and also add the missing mdspan::empty(). In the following LWG small-group review session, noexcept additions are approved, but a new function need its own proposal to pass through LEWG review again. Thus the paper.

History:

  • 2022-07-25: R1 approved for inclusion in C++23 in the 2022-07-25 WG21 plenary. (Plenary -> Approved)
  • 2022-07-23: R1 passed 2022-07 LEWG Electronic Poll. (EP -> Plenary)
  • 2022-07-08: R1 seen by LWG, approved for plenary. (Stage 3 preapproval)
  • 2022-06-28: R0 seen by LEWG (of which I forgot to attend the telecon, sorry!), approved for EP. (Stage 2 -> EP)
  • 2022-06-25: P2613R1 shipped in the 2022-07 Mailing (LWG request a one-line wording change, so this is quick).
  • 2022-06-23: P2613R0 shipped in the 2022-06 Mailing (as a late paper).

P3351: views::scan#

  • Audience: LEWG
  • Target: C++29
  • Revisions: R0, R1, R2, R3, R4
  • Current Status: Stage 2

This paper proposes the views::scan range adaptor, which takes a range and a function that takes the current element and the current state as parameters. Basically, views::scan is a lazy view version of std::inclusive_scan, or views::transform with a stateful function.

History:

P3423: Extending User-Generated Diagnostic Messages#

  • Audience: CWG
  • Target: C++29
  • Revisions: R0, R1, R2
  • Current Status: Stage 3

During Varna (2023-06), P2741R3 had been adopted into the C++26 working draft, which gave static_assert the ability to accept a user-generated string-like object as the message parameter. This extension allowed the user of static_assert to provide a more precise error message in compile time, thus significantly increasing the user-friendliness of libraries. This proposal, therefore, proposes to unify the language by allowing other constructs in the language that currently accept a message parameter, namely [[nodiscard]], [[deprecated]], and = delete, to also allow a user-generated string-like object as the provided message.

History:

P3831: Contract Labels Should Use Annotation Syntax#

  • Audience: SG21
  • Target: P3400R1
  • Revisions: R0
  • Current Status: Rejected

Contract labels (P3400R1) are one of the most important extensions proposed to C++26 Contracts, providing the ability to control the behavior of specific contract assertions. This proposal argues that instead of inventing a new syntax for parameterizing contract assertions, the labels should utilize the existing feature in the standard that permits this parameterization with defined semantics, namely annotations (P3394R4).

History:

  • 2025-09-07: P3831R0 shipped in the 2025-09 Mailing.
  • 2026-06-09: R0 seen by EWG in Brno (2026-06) and rejected. (Stage 1 -> Stage 2 -> Rejected)

P4205: Range-Based Searchers#

  • Audience: SG9
  • Target: C++29
  • Revisions: R0, R1
  • Current Status: Stage 1

This proposal introduces std::ranges versions of the Searcher overload of the std::search algorithm, which takes a searcher object instead of an iterator pair and (optionally) a predicate. It was originally introduced for more performant specialized searching.

As customary in Ranges algorithms, this proposal also proposes Range-ified versions of the existing standard searchers, along with a concept std::searchable for better capturing the semantic requirements of standard searchers.

History:

P4211: Adaptors For Closed Ranges#

  • Audience: SG9
  • Target: C++29
  • Revisions: R0
  • Current Status: Stage 1

This proposal introduces a family of adaptors that convert closed ranges into half-open ranges, as expected by most other standard library facilities in C++, thus providing direct support for a range model that has been fundamentally incompatible with the C++ iterator model until now.

History: