Ray's playground

 

Item 40: Use multiple inheritance judiciously(Effective C++)

  • Multiple inheritance is more complex than single inheritance. It can lead to new ambiguity issues and to the need for virtual inheritance.

  • Virtual inheritance imposes costs in size, speed, and complexity of initialization and assignment. It's most practical when virtual base classes have no data.

  • Multiple inheritance does have legitimate uses. One scenario involves combining public inheritance from an Interface class with private inheritance from a class that helps with implementation.

posted on 2011-04-05 10:36  Ray Z  阅读(167)  评论(0编辑  收藏  举报

导航