From d3a523eea85efb332957b9cc52f8f3846dcc0df6 Mon Sep 17 00:00:00 2001 From: Andrew Pardoe Date: Mon, 11 Dec 2017 11:13:07 -0800 Subject: [PATCH] Typos found at I.* (#1093) * Typo: change word compute by inserted code . is the name of a previous function. * Typo: add missing comma * Typo: minor period typo * Typo: form lower to upper case * Typos found at I.* Typo: add missing comma Typo: minor period typo Typo: form lower to upper case Typos found at I.* --- CppCoreGuidelines.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 288645b..05f8944 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1736,7 +1736,7 @@ Many traditional interface functions (e.g., UNIX signal handlers) use error code ##### Alternative -If you can't use exceptions (e.g. because your code is full of old-style raw-pointer use or because there are hard-real-time constraints), consider using a style that returns a pair of values: +If you can't use exceptions (e.g., because your code is full of old-style raw-pointer use or because there are hard-real-time constraints), consider using a style that returns a pair of values: int val; int error_code; @@ -1789,7 +1789,7 @@ Consider: return res; } -Who deletes the returned `X`? The problem would be harder to spot if compute returned a reference. +Who deletes the returned `X`? The problem would be harder to spot if `compute` returned a reference. Consider returning the result by value (use move semantics if the result is large): vector compute(args) // good @@ -2219,7 +2219,7 @@ We might write This violated the rule [against uninitialized variables](#Res-always), the rule against [ignoring ownership](#Ri-raw), -and the rule [against magic constants](#Res-magic) . +and the rule [against magic constants](#Res-magic). In particular, someone has to remember to somewhere write if (owned) delete inp; @@ -2253,7 +2253,7 @@ Presumably, a bit of checking for potential errors would be added in real code. ##### Enforcement * Hard, it is hard to decide what rule-breaking code is essential -* flag rule suppression that enable rule-violations to cross interfaces +* Flag rule suppression that enable rule-violations to cross interfaces # F: Functions