Multiple Inheritance Gotchas


I just hit a multiple inheritance gotcha - I added a timer to an overlay class ripped off from the Jucer, and it kept failing in an internal selectedset add critical section. I presume it was due to ambiguity, since the Timer is a ChangeListener, and the class specifically inherits from ChangeListener (and seems to need to to be happy.

Is it cheesy that GCC (Xcode) didn’t spot this? Or normal? A simple cast ‘solved’ it, but I suspect this crops up a fair amount with Juce?

Not as daunting as I feared, but I wish it was caught before runtime. Anyone have good tips to avoid this?



I don’t actually remember ever hitting a multiple inheritance problem like this, so it can’t be all that common. I seem to remember that MSVC throws an error or warning in situations like this, but maybe you just need to crank up the warning level in GCC?