摘要: 引用计数的实现:template class ReferenceCount{public: explicit ReferenceCount(T* p):ptr(p),count(new int(1)){} ReferenceCount(const ReferenceCount& p) throw() : ptr(p.ptr),count(p.count) { ++*count; } ReferenceCount& operator = (const ReferenceCount& p) { if(this != &p) { dispose(); ... 阅读全文
posted @ 2013-07-27 14:19 极限游乐园 阅读(193) 评论(0) 推荐(0) 编辑