此外,在类中用typedef定义的类型别名还具有相应的访问权限,【例3.4】:
class A
{
typedefunsignedint UINT;
UINT valueA;
A(): valueA(0){}
};
void func3()
{
A::UINT i =1;
// error C2248: 'A::UINT' : cannot access private typedef declared in class 'A'
}
而给UINT加上public访问权限后,则可编译通过。