Skip to content

Commit 542d37c

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2385 from JordanMaples/patch-12
Add C++ Core Guidelines link to C26418
2 parents ad9870c + 90bf30b commit 542d37c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/code-quality/c26418.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.assetid: d2c84a40-8a5d-4018-92c2-6498cdd9b541
1111
> Shared pointer parameter is not copied or moved. Use T* or T& instead.
1212
1313
**C++ Core Guidelines**:
14-
R.36: Take a const shared_ptr\<widget>& parameter to express that it might retain a reference count to the object
14+
[R.36](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#r36-take-a-const-shared_ptrwidget-parameter-to-express-that-it-might-retain-a-reference-count-to-the-object-): Take a const shared_ptr\<widget>& parameter to express that it might retain a reference count to the object
1515

1616
If shared pointer parameter is passed by value or reference to a constant object it is expected that function will take control of its target object’s lifetime without affecting of the caller. The code should either copy or move the shared pointer parameter to another shared pointer object or pass it further to other code by invoking functions which accept shared pointers. If this is not the case, then plain pointer or reference may be feasible.
1717

0 commit comments

Comments
 (0)