P4020R0 — Concerns about contract assertions
(4 items)
EWG
This paper raises concerns about the contract assertions feature (P2900R14) that was voted into the C++ Committee Draft, arguing that there is insufficient real-world experience with precondition and postcondition declarations in function signatures (as opposed to assertions in function bodies) to confidently standardize the feature. The author contends that objections from compiler vendors (Microsoft and EDG) and the failure of a significant portion of WG21 to adopt the underlying model are important warning signs. The paper recommends that EWG either ship the feature as-is or move C++ contracts to a future standard, and argues against adding last-minute patches or competing alternatives during the National Ballot phase.
- Section "Contracts in general", paragraph 2 — "coopertion" is misspelled; missing the letter 'a' before "tion" — should be "cooperation". [1] [1]
- Section "Contracts in general", paragraph following the draw_rect example — Subject-verb disagreement: "this exist" should be "this exists". [2] [2]
- Section "Concerns about contract assertions", opening paragraph — Wrong past participle: "risen" is intransitive and cannot be used in a passive construction — should be "a number of concerns have been raised". [3] [3]
References — Anthropic Citations API
[1]
chars 5621–5795
"If one person creates a component and another uses it, in order for this cöopertion to work both parties need to have the same understanding on what this component does. "
"If one person creates a component and another uses it, in order for this cöopertion to work both parties need to have the same understanding on what this component does. "
[2]
chars 6031–6536
"Consider:
"Consider:
double atan2(double, double);
In this function, which of the parameters represents the x and which the y..."
[3]
chars 0–5058
"
"