You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Shared pointer parameter is not copied or moved. Use T* or T& instead.
12
12
13
13
**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
15
15
16
16
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.
0 commit comments