您的位置:首页 > 移动开发 > Objective-C

Object layout in C++ and access control

2014-04-30 20:09 411 查看
The variables are guaranteed to be laid out contiguously, as in C. However, the access blocks may not appear in the object in the order that you declare them.

Access specifier are part of the structure and donot affect the objects created from the structure. All of the access specification information disappears before the program is run; generally this happens during compilation. In a running program, objects become "regions of storage" and nothing more.    (Page 270)

In fact, the compiler is the only thing that kowns about the protection level of class members. There is no access control information mangled into the member name that carries through to the linker. All the protection checking is done by the compiler; it has vanished by runtime.    (Page 275)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: