/**
* @brief A smart pointer with reference-counted copy semantics.
*
* The object pointed to is deleted when the last shared_ptr pointing to
* it is destroyed or reset.
*/
shared_ptr继承自__shared_ptr,它负责包装__shared_ptr的接口,最终使用的都是__shared_ptr的成员函数。
* @brief A smart pointer with reference-counted copy semantics.
*
* The object pointed to is deleted when the last shared_ptr pointing to
* it is destroyed or reset.
*/
shared_ptr继承自__shared_ptr,它负责包装__shared_ptr的接口,最终使用的都是__shared_ptr的成员函数。
template<typename _Tp>
class shared_ptr : public __shared_ptr<_Tp>
![](https://app.yinxiang.com/shard/s51/res/ece42dbb-74f2-4de6-bf52-70b9baa1582a/P50714-111415.jpeg)
![](https://app.yinxiang.com/shard/s51/res/c47a21bf-846c-4837-85d1-8aeca7771546/P50714-111430-001.jpeg)