Inheritance by dominance - is it really bad?

前端 未结 3 1853
粉色の甜心
粉色の甜心 2021-02-12 12:02

I\'m one of those people that has to get their code to compile with 0 warnings. Normally I respect the compiler and if it issues me a warning I take it as a sign that I should t

3条回答
  •  悲哀的现实
    2021-02-12 12:32

    Is there a reason you aren't writing:

    class Quux : public Bar, public Baz
    {
        using Bar::foo;
    };
    

    ?

    This gives you the same level of reuse, without the fragility.

提交回复
热议问题