
9 Apr
2009
9 Apr
'09
3:55 p.m.
AMDG Dongfei Yin wrote:
I write some code like this:
#include <iostream>
using namespace std;
class Base1 { public: typedef Base1 base; };
class Base2 { typedef Base2 base; public: };
class A : public Base1 , public Base2 { public: A() { base::f(); } };
the output depends on the sequence of base class, that means the "typedef" in base class is unreliable. complier gives no warning. I try these code at both VS2005 and VS2008, the result are same.
I don't think this should actually compile, since base is ambiguous. (gcc doesn't compile it) In Christ, Steven Watanabe