摘要:
http://www.cplusplus.com/reference/vector/vector/?kw=vector C++中,vector<bool>为了达到节省内存的目的,专门做了特化,大概方式就是用bit位来存储数组中的元素。代价就是,这个容器里面的内置类型乱掉了: member type 阅读全文
摘要:
/* The synchronization referred to is @e only that between the standard * C facilities (e.g., stdout) and the standard C++ objects (e.g., * cout).... 阅读全文
摘要:
Consider the following example:class Base {public: virtual void foo() = 0; virtual void bar() = 0;};class Der1 : public virtual Base {public: virtu... 阅读全文
摘要:
When should my destructor be virtual?When someone will delete a derived-class object via a base-class pointer.In particular, here’s when you need to m... 阅读全文
摘要:
How can I protect derived classes from breaking when I change the internal parts of the base class?A class has two distinct interfaces for two distinc... 阅读全文