摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c... 阅读全文
posted @ 2015-10-12 18:55 eversliver 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 首先考虑的是一个很典型的关系,就是矩形与正方形的关系: 1 class Recantagle{ 2 virtual void setHeight(int); 3 virtual void setWidth(int); 4 virtual int height(int)cons... 阅读全文
posted @ 2015-10-12 17:45 eversliver 阅读(252) 评论(0) 推荐(0) 编辑
摘要: inline可以带来各种好处:首先其可以使得消除函数调用带来的开销,再者编译器对这种非函数的代码可以做出更多的优化策略。但是inline函数首先肯定是会导致程序代码的大小更加的庞大,这样会带来代码膨胀,造成的损害首先就是会导致计算机额外的换页行为,降低指令告诉缓存的集中率,这要就会带来效率上的损失。... 阅读全文
posted @ 2015-10-12 17:44 eversliver 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 首先看看下面这个例子: 1 class Point{ 2 public: 3 point(int x, int y); 4 ... 5 void setX(int newVal); 6 void setY(int newVal); 7 ... 8 }; 9 s... 阅读全文
posted @ 2015-10-12 17:42 eversliver 阅读(404) 评论(0) 推荐(0) 编辑