klotz@parc.xerox.com (09/14/89)
In g++
The message
% g++ mu.cc -o mu
In function int main ():
mu.cc:25: member `top' belongs to MI-distinct base classes `report'
Shouldn't this message be the other way around, since "top" is a class
and "report" is a member? Also, it took me a while to figure out out that
"MI" means "multiple-inheritance," but I'm still not sure exactly what
"MI-distinct" means. (I do understand the error itself -- in fact, I was
trying what would happen.)
Leigh.
#include <stdio.h>
struct top {
int a = 0;
virtual int report() { return a; };
};
struct top_left : public top {
int a = 1;
};
struct top_right : public top {
int a = 2;
};
struct bottom : public top_left, public top_right {
int b;
};
main()
{
bottom x;
printf("%d\n", x.report());
}