2017年3月17日

实现一个简单的shared_ptr

摘要: template class shared_ptr { public: explicit shared_ptr (T *ptr): mPtr(ptr), cnt(new int(1)){} shared_ptr(const shared_ptr& rhs): mPtr(rhs.mPtr), cnt(rhs.cnt){ ++*cnt; } shared_ptr& oper... 阅读全文

posted @ 2017-03-17 17:09 yohaha 阅读(146) 评论(0) 推荐(0) 编辑

导航