How are my WG21 proposals doing?

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

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:

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

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:

P2613: Add the missing empty() to mdspan

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:

P3351: views::scan

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

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

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:

P4205: Range-Based Searchers

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

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: