3

I am currently learning C++. There are only 2 ways i have come across to resolve ambiguity, one is by using scope resolution operator (::) and another by using 'virtual' keyword when I am dealing with multiple inheritance and hybrid inheritance.

My question is: Can ambiguity only occur in multiple inheritance and hybrid inheritance or can it also occur in any other form of inheritance? and in what other different ways can those ambiguities be resolved?

Raphael
  • 9,779
  • 5
  • 63
  • 94
  • 3
    There are numerous ways of introducing ambiguity in C++, including by misuse of `using namespace`, function overloading, etc. Some of those come into play with single inheritance structures, and some don't even involve a class hierarchy. Multiple inheritance just adds some more types of ambiguity to the mix. This question is therefore too broad for this format - there are numerous possible ways to achieve ambiguity, and even more numerous ways to correct or avoid those ambiguities. In OOP more generally, similar considerations apply. – Peter Mar 11 '16 at 23:30

0 Answers0