From ff623adc6bdad881aef7e830d9a642ac5be236c9 Mon Sep 17 00:00:00 2001 From: Andreas Scherer Date: Sun, 18 Oct 2015 16:29:02 +0200 Subject: [PATCH] Mismatching and missing quotes. And other problems fixed. --- CppCoreGuidelines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 52e7574..b10465f 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -6428,7 +6428,7 @@ Returning a (raw) pointer imposes a life-time management burden on the caller; t delete p; } -In addition to suffering from the problem from [leak](#???), this adds a spurious allocation and deallocation operation, and is needlessly verbose. If Gadget is cheap to move out of a function (i.e., is small or has an efficient move operation), just return it "by value:' +In addition to suffering from the problem from [leak](#???), this adds a spurious allocation and deallocation operation, and is needlessly verbose. If Gadget is cheap to move out of a function (i.e., is small or has an efficient move operation), just return it "by value": Gadget make_gadget(int n) { @@ -6802,7 +6802,7 @@ be able to destroy a cyclic structure. ??? (HS: A lot of people say "to break cycles", while I think "temporary shared ownership" is more to the point.) ???(BS: breaking cycles is what you must do; temporarily sharing ownership is how you do it. -You could "temporarily share ownership simply by using another `stared_ptr`.) +You could "temporarily share ownership" simply by using another `stared_ptr`.) ##### Enforcement @@ -6852,7 +6852,7 @@ A function that does not manipulate lifetime should take raw pointers or referen ##### Enforcement -* (Simple) Warn if a function takes a parameter of a type that is a `Unique_ptr` or `Shared_ptr` and the function only calls any of: `operator*`, `operator->` or `get()`). +* (Simple) Warn if a function takes a parameter of a type that is a `Unique_ptr` or `Shared_ptr` and the function only calls any of: `operator*`, `operator->` or `get()`. Suggest using a `T*` or `T&` instead. ### R.31: If you have non-`std` smart pointers, follow the basic pattern from `std`