How are my WG21 proposals doing?
C++, WG21 ·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:
- 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");
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
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
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:
- 2025-01-12: P3351R2 shipped in the 2025-01 pre-Hagenberg Mailing.
- 2024-09-24: P3351R1 shipped in the 2024-10 pre-Wrocław Mailing.
- 2024-07-08: P3351R0 shipped in the 2024-07 post-St. Louis Mailing.
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:
- 2025-01-12: P3423R1 shipped in the 2025-01 pre-Hagenberg Mailing.
- 2024-11-22: P3423R0 seen by EWGI in Wrocław (2024-11), approved for EWG. (Stage 1 -> Stage 2)
- 2024-10-14: P3423R0 shipped in the 2024-10 pre-Wrocław Mailing.