diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index e2f130a..f479687 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -9993,14 +9993,9 @@ Using `unique_ptr` in this way both documents and enforces the function call's o void uses(widget*); // just uses the widget -##### Example, bad - - void thinko(const unique_ptr&); // usually not what you want - ##### Enforcement * (Simple) Warn if a function takes a `Unique_pointer` parameter by lvalue reference and does not either assign to it or call `reset()` on it on at least one code path. Suggest taking a `T*` or `T&` instead. -* (Simple) ((Foundation)) Warn if a function takes a `Unique_pointer` parameter by reference to `const`. Suggest taking a `const T*` or `const T&` instead. ### R.33: Take a `unique_ptr&` parameter to express that a function reseats the `widget` @@ -10016,14 +10011,9 @@ Using `unique_ptr` in this way both documents and enforces the function call's r void reseat(unique_ptr&); // "will" or "might" reseat pointer -##### Example, bad - - void thinko(const unique_ptr&); // usually not what you want - ##### Enforcement * (Simple) Warn if a function takes a `Unique_pointer` parameter by lvalue reference and does not either assign to it or call `reset()` on it on at least one code path. Suggest taking a `T*` or `T&` instead. -* (Simple) ((Foundation)) Warn if a function takes a `Unique_pointer` parameter by reference to `const`. Suggest taking a `const T*` or `const T&` instead. ### R.34: Take a `shared_ptr` parameter to express shared ownership