03 2015 档案
摘要:Understand the ins and outs of inlining.[原理]Inline函数背后的做法是将“对函数的每一个调用”都用函数本体(function body)替换之。其好处是:可以消除函数调用所带来的开销。编译器最优化机制通常被设计用来浓缩那些“不含函数调用”的代码,因此当你...
阅读全文
摘要:Declare destructors virtual in polymorphic base classes.[原理]C++指出,当derived class对象经由一个由base class类型的指针删除时,如果这个base class 拥有一个non-virtual的析构函数,那个析构的结果将...
阅读全文

浙公网安备 33010602011771号