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 family, 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.

This paper also proposed views::prescan and views::partial_sum as convenient aliases.

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: