Authors: Darius Neațu (@neatudarius), David Sankel (@camio)
Audience: Library Evolution
Description: The committee spends substantial time deciding whether or not [[nodiscard]] is appropriate for newly introduced standard functions, and the decisions made are often incoherent. We propose a policy that results in minimal syntactic overhead while retaining the detection of the most egregious defects.
Note: This repo/paper is work for WG21: C++ Standards Committee Papers.
- P3162R0:
- https://wg21.link/P3162R0, 2024-02-22
- source: P3162R0.md
- status: no consensus in LEWG Tokyo 2024. Other approach must be found.
- P3201R1:
- https://wg21.link/P3201R1, 2024-03-22
- source: P3201R1.md
- status:
- Co-authored with Jonathan Wakely (@jwakely) a joint new proposal.
- Got consensus in LEWG Tokyo 2024.
- Forwarded to 2024-04 Library Evolution Polls (P3213R0).
- Results published in 2024-04 Library Evolution Poll Outcomes (P3214R0).
- Consensus achieved.
Final status: P3201R1
was adopted into SD-9: Library Evolution Policies:
Policy: Library wording should not use [[nodiscard]] (P3201R1: LEWG [[nodiscard]] policy (Jonathan Wakely, David Sankel, Darius Neațu))
Rationale: Warnings are non-normative so [[nodiscard]] placement has a spurious impact. Furthermore, implementors are better qualified to identify when and where to emit warnings for their implementations.