menu

hjk41的日志

Avatar

Effective C++ 44: Say what you mean; understand what you're saying

This is a summary of Item 35-43.
. A common base class means common traits.
. Public inheritance means isa.
. Private inheritance means is-implemented-in-terms-of.
. Layering means has-a or is-implemented-in-terms-of.

And when public inheritance is concerned:
. A pure virtual function means that only the interface of the function is inherited.
. A simple virtual function means that the function's interface plus a default implementation is inherited.
. A nonvirtual function means that the function's interface plus a mandatory implementation is inherited.

评论已关闭