Skip to content

Commit c296501

Browse files
authored
Add C++ Core Guidelines link to C26416
The rule was already written in the description, so I added a link to the documentation.
1 parent c6184f0 commit c296501

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/code-quality/c26416.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.assetid: f158207b-45cf-44cf-8e4b-b5b75b56ea0e
1111
> Shared pointer parameter is passed by rvalue reference. Pass by value instead.
1212
1313
**C++ Core Guidelines**:
14-
R.34: Take a shared_ptr\<widget> parameter to express that a function is part owner
14+
[R.34](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#r34-take-a-shared_ptrwidget-parameter-to-express-that-a-function-is-part-owner): Take a shared_ptr\<widget> parameter to express that a function is part owner
1515

1616
Passing a shared pointer by rvalue reference is usually unnecessary. Unless it is an implementation of move semantics for a shared pointer type itself, shared pointer objects can be safely passed by value. Using rvalue reference may be also an indication that unique pointer is more appropriate since it clearly transfers unique ownership from caller to callee.
1717

0 commit comments

Comments
 (0)