rlb*_*ond 12 c++ enums typedef
所以这是我的问题:
struct A
{
enum A_enum
{
E0,
E1,
E2
};
};
struct B
{
typedef A::A_enum B_enum;
bool test(B_enum val)
{
return (val == E1); // error: "E1" undeclared identifier
}
};
Run Code Online (Sandbox Code Playgroud)
我特意不想说A::E1.如果我尝试,B_enum::E1我会收到一个非标准的警告.有没有办法做这样的事情?