I need to inherit from two interfaces which both have the same method which in both cases should perform exactly the same thing. Is this code correct or not? I need this for some kind of proxy class. Thanks for answers.
class InnerInterface {
    virtual int getID() const = 0;
    //...
};
class OuterInterface {
    virtual int getID() const = 0;
    //...
};
class Foo : public InnerInterface, public OuterInterface {
    virtual int getID() const;
    //all abstract methods
};
                Yes, this is correct. The single getID() method can override both virtual methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With