Skip to content

Commit f5d7920

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2383 from JordanMaples/patch-10
Add C++ Core Guidelines link to C26416
2 parents c4af0bc + c296501 commit f5d7920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)