what to do with : Warning: ..... inherits ..... via dominance

I saw this example of dynamic dispatch and polymorphism in c_scene issue 8

class Printable {
public:
virtual void print()=0
};
class Caller:private virtual Printable {
public:
void print_it(){print();}
};
class PrintText1:public void Printable {
public:
virtual void print(){cout<<"Text1"}
};
void print_caller(Caller &obj) {
obj.print_it();
}
int main() {
class Text : public Caller, public PrintText1{};
Text text;
print_caller(text);
return 0;
}

After linking Iget the message:
warning main::Text:inherits PrintText1::print via dominance

Questions : I don't really understand the meaning of this specific warning. Is it something I can disregard or is it a potential serious problem and how to solve it?

Thanks and (almost) happy newyear, greetinx from Winnitou





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories