Effective C++: discouraging protected inheritance?

前端 未结 5 611
北恋
北恋 2021-02-02 11:10

I was reading Scott Meyers\' Effective C++ (third edition), and in a paragraph in Item 32: Make sure public inheritance is \"is-a\" on page 151 he make

5条回答
  •  猫巷女王i
    2021-02-02 11:45

    He isn't exactly discouraging protected inheritance, he just says that he hasn't found any good use for it. I haven't seen anyone either elsewhere.

    If you happen to find a couple of really useful use cases, you might have material to write a book too. :-)

提交回复
热议问题