- Fixed an inconsistent title (section ToC and actual guideline title
differed)
- Can't reseat a reference, so changed it to pointer
- Removed what I think is a stray/outdated rule against passing
move-only types (unique_ptr) by &&
- Reordered a three-line example for logical flow
@ -8700,7 +8700,7 @@ Using `unique_ptr` in this way both documents and enforces the function call's o
void sink(unique_ptr<widget>); // consumes the widget
void sink(widget*); // just uses the widget
void uses(widget*); // just uses the widget
##### Example, bad
@ -8710,7 +8710,6 @@ Using `unique_ptr` in this way both documents and enforces the function call's o
* (Simple) Warn if a function takes a `Unique_ptr<T>` 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_ptr<T>` parameter by reference to `const`. Suggest taking a `const T*` or `const T&` instead.
* (Simple) ((Foundation)) Warn if a function takes a `Unique_ptr<T>` parameter by rvalue reference. Suggest using pass by value instead.
### <aname="Rr-reseat"></a>R.33: Take a `unique_ptr<widget>&` parameter to express that a function reseats the`widget`
@ -8720,7 +8719,7 @@ Using `unique_ptr` in this way both documents and enforces the function call's r
##### Note
"reseat" means "making a reference or a smart pointer refer to a different object."
"reseat" means "making a pointer or a smart pointer refer to a different object."
##### Example
@ -8734,7 +8733,6 @@ Using `unique_ptr` in this way both documents and enforces the function call's r
* (Simple) Warn if a function takes a `Unique_ptr<T>` 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_ptr<T>` parameter by reference to `const`. Suggest taking a `const T*` or `const T&` instead.
* (Simple) ((Foundation)) Warn if a function takes a `Unique_ptr<T>` parameter by rvalue reference. Suggest using pass by value instead.
### <aname="Rr-sharedptrparam-owner"></a>R.34: Take a `shared_ptr<widget>` parameter to express that a function is part owner
@ -8746,10 +8744,10 @@ This makes the function's ownership sharing explicit.
* (Simple) Warn if a function takes a `Shared_ptr<T>` 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.