2013年5月18日
摘要: 读《C++ Stragegies and Tacitics》的时候看到了一段很NB的代码,是关于智能指针的 (程序稍作修改,以便在编译器上运行): 1 #include <string> 2 using namespace std; 3 4 class String_ptr { 5 private: 6 string *ptr; 7 public: 8 String_ptr(string *s) : ptr(s) {} 9 string* operator ->() const {return ptr;}10 operator string*() const... 阅读全文
posted @ 2013-05-18 17:14 wanghetao 阅读(384) 评论(0) 推荐(0) 编辑