摘要: /*用计数器count,模拟基本的智能指针在这里我定义,作为源的指针叫源指针,然后源指针的第一份copy叫父指针,父指针的copy叫子指针*/#include <iostream>using namespace std;class SmartPointer //父指针类,{public: friend class Invoke;public: int* sptr; int count; SmartPointer(int *ptr):sptr(ptr),count(1){} ~SmartPointer() { cout<<"... 阅读全文
posted @ 2012-04-14 20:39 KelvinDesus 阅读(216) 评论(0) 推荐(0)