Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 770 Bytes

15.32.md

File metadata and controls

7 lines (4 loc) · 770 Bytes

Copy: The shared_ptr pointer is copyed. Both the new and the old pointers point to the same object. The reference count to object pointed by both pointers is increased.

Move: The shared_ptr pointer is moved. The new pointer points to the object, and the old pointer is destroyed. The reference count to object pointed by the old pointer is not changed.

Assign: The shared_ptr pointer is copyed from right-hand side to left-hand side. The reference count to object pointed by the lhs pointer is decreased, and the reference count to object pointed by the rhs pointer is increased.

Destroy: The shared_ptr pointer is destroyed. The reference count to object pointed by the pointer is decreased, and if the reference count is zero, the object is also destroyed.