<分区>
Possible Duplicate:
How do you import an enum into a different namespace in C++?
如何解决以下枚举命名空间问题?
namespace A {
typedef enum ABar { a, b };
void foo( ABar xx ) {}
}
namespace B {
typedef enum A::ABar BBar;
void foo( BBar xx ) { A::foo( xx ); }
}
int main() {
B::foo( B::a ); // 'a' : is not a member of 'B'
// 'a' : undeclared identifier
}