请看下面这段代码:
class tA
{
public:
enum tE
{
i_0,
i_1,
};
void cShow()
{
cout << i_0 << endl;
}
};
class tB
{
public:
typedef tA::tE tE; // typedef 无用啊……
void cShow()
{
cout << i_0 << endl; // 报错:“i_0”未定义
}
};
class tA
{
public:
enum tE
{
i_0,
i_1,
};
void cShow()
{
cout << i_0 << endl;
}
};
class tB
{
public:
typedef tA::tE tE; // typedef 无用啊……
void cShow()
{
cout << i_0 << endl; // 报错:“i_0”未定义
}
};