Why does C++ not let baseclasses implement a derived class' inherited interface?

前端 未结 5 649
迷失自我
迷失自我 2020-11-29 09:17

Here is what I am talking about

// some guy wrote this, used as a Policy with templates
struct MyWriter {
  void write(std::vector const& dat         


        
5条回答
  •  隐瞒了意图╮
    2020-11-29 10:11

    Just make MyWriter derive from IWriter, eliminate the IWriter derivation in MyOwnClass, and move on with life. This should resolve the problem and should not interfere with the template code.

提交回复
热议问题