c++相關(類 stdshared_ptr 接口 常規使用)

智能指針可分爲:1、auto_ptr;2、shared_ptr 3、unique_ptr 4、weaked_ptr其中auto_ptr已經廢棄不用 shared_ptr的常用使用方式: shared指針提供自帶user_count()函數:用於記錄指針使用的人數,unique()函數用於判斷當前使用的用戶是否唯一 用引用技術傳入指針並不會改變外部指針的user_count否則以值的方式傳入相當於拷
相關文章
相關標籤/搜索