From 684635eecda0e507b966dd343ffe1cd6df99c13e Mon Sep 17 00:00:00 2001 From: hsutter Date: Thu, 14 Feb 2019 11:13:42 -0800 Subject: [PATCH] Closes #1322 Add an Enforcement rule for prefix inc/dec functions. Try to phrase it to reduce noisiness. --- CppCoreGuidelines.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 7951425..84cbbe7 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1069,6 +1069,9 @@ After that, we can look at waste related to algorithms and requirements, but tha Many more specific rules aim at the overall goals of simplicity and elimination of gratuitous waste. +* Flag an unused return value from a user-defined non-defaulted postfix `operator++` or `operator--` function. Prefer using the prefix form instead. (Note: "User-defined non-defaulted" is intended to reduce noise. Review this enforcement if it's still too noisy in practice.) + + ### P.10: Prefer immutable data to mutable data ##### Reason