/LEWG-no-discard-policy

WG21 P3162: LEWG [[nodiscard]] policy

Primary LanguageMarkdown

WG21 P3162: LEWG [[nodiscard]] policy

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.

Published Revisions

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.