摘要:
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... 阅读全文
摘要:
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;... 阅读全文
摘要:
类似的问题还有: why can't class template use Handle Class Pattern to hide its implementation? || why there are linker problems (undefined reference) to my cl... 阅读全文
摘要:
为什么会想到这个问题?因为我总是不自觉地将c++和java进行对比。java对这种情况的处理方式是constructor返回一个null,然后已经构造的objects交给Garbage Collector处理,那么c++没有Garbage Collector,会是怎么样的一种情况呢?为了找到这个问题... 阅读全文