随笔分类 -  STL 源码

摘要:STL中的智能指针(Smart Pointer)及其源码剖析: std::unique_ptr 和 std::auto_ptr一样,std::unique_ptr也是一种智能指针,它也是通过指针的方式来管理对象资源,并且在 unique_ptr 的生命期结束后释放该资源。unique_ptr 持有对 阅读全文
posted @ 2017-02-23 21:58 杨领well 阅读(74) 评论(0) 推荐(0)
摘要:STL中的智能指针(Smart Pointer)及其源码剖析: std::auto_ptr auto_ptr 是STL中的智能指针家族的成员之一, 它管理由 new expression 获得的对象,在 auto_ptr 对象销毁时,他所管理的对象也会自动被 delete 掉。auto_ptr 的拷 阅读全文
posted @ 2017-02-20 12:22 杨领well 阅读(93) 评论(0) 推荐(0)