摘要: Reference material:Thinking In C++ 2nd eidition chapter 5 section "Handle classes"If there's something need to be hidden from clients of the class (su... 阅读全文
posted @ 2014-11-19 18:50 rldts 阅读(251) 评论(0) 推荐(0) 编辑
摘要: main.cpp 1 #include "Stack.h" 2 3 #include 4 5 using namespace std; 6 7 class Box { 8 public: 9 Box():data(0), ID(num++) { cout data = b.data;... 阅读全文
posted @ 2014-11-19 18:16 rldts 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 类似的问题还有: why can't class template use Handle Class Pattern to hide its implementation? || why there are linker problems (undefined reference) to my cl... 阅读全文
posted @ 2014-11-19 17:36 rldts 阅读(1111) 评论(0) 推荐(0) 编辑
摘要: 为什么会想到这个问题?因为我总是不自觉地将c++和java进行对比。java对这种情况的处理方式是constructor返回一个null,然后已经构造的objects交给Garbage Collector处理,那么c++没有Garbage Collector,会是怎么样的一种情况呢?为了找到这个问题... 阅读全文
posted @ 2014-11-19 01:09 rldts 阅读(447) 评论(0) 推荐(0) 编辑