diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index df5a316..46c1324 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2230,7 +2230,7 @@ We can catch dangling pointers statically, so we don't need to rely on resource ##### Enforcement -* Flag a parameter of a smart pointer type (a type that overloads `operator->` or `operator*`) that is copyable but never copied/moved from in the function body or else movable but never moved from in the function body or by being a by-value parameter, and that is never assigned to, and that is not passed along to another function that could do so. That means the ownership semantics are not used. +* Flag a parameter of a smart pointer type (a type that overloads `operator->` or `operator*`) that is copyable but never copied/moved from in the function body or else movable but never moved from in the function body or by being a by-value parameter, and that is never modified, and that is not passed along to another function that could do so. That means the ownership semantics are not used. ### F.8: Prefer pure functions @@ -7315,7 +7315,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 smart pointer type (that overloads `operator->` or `operator*`) `unique_ptr` or `shared_ptr` and the function only calls any of: `operator*`, `operator->` or `get()`. -* Flag a parameter of a smart pointer type (a type that overloads `operator->` or `operator*`) that is copyable but never copied/moved from in the function body or else movable but never moved from in the function body or by being a by-value parameter, and that is never assigned to, and that is not passed along to another function that could do so. That means the ownership semantics are not used. +* Flag a parameter of a smart pointer type (a type that overloads `operator->` or `operator*`) that is copyable but never copied/moved from in the function body or else movable but never moved from in the function body or by being a by-value parameter, and that is never modified, and that is not passed along to another function that could do so. That means the ownership semantics are not used. Suggest using a `T*` or `T&` instead. ### R.31: If you have non-`std` smart pointers, follow the basic pattern from `std`