Given an interface (in the c++ sense, nothing more than a struct containing pure virtual methods)
struct Iv1 {
virtual method0()=0; };
And a class that implements the interface
class Iv1Impl : public Iv1 {
virtual method0(){...}
}
Its not unreasonable to create a version 2 interface
struct Iv2 : Iv1 {
virtual method1()=0;};
One might *try* to create an implementation class like this
class Iv2Impl : public Iv2, Iv1Impl {
virtual method1(){...}; // implement Iv2 method
};
That of course never never never works. Why not? So what that Ive introduced another method0()=0 ? Why can't it figure out it already has an implementation for that method that I'd really like to allow it to use?
struct Iv1 {
virtual method0()=0; };
And a class that implements the interface
class Iv1Impl : public Iv1 {
virtual method0(){...}
}
Its not unreasonable to create a version 2 interface
struct Iv2 : Iv1 {
virtual method1()=0;};
One might *try* to create an implementation class like this
class Iv2Impl : public Iv2, Iv1Impl {
virtual method1(){...}; // implement Iv2 method
};
That of course never never never works. Why not? So what that Ive introduced another method0()=0 ? Why can't it figure out it already has an implementation for that method that I'd really like to allow it to use?
Comment