• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            asm, c, c++ are my all
            -- Core In Computer
            posts - 139,  comments - 123,  trackbacks - 0

            ********************************************\
            |????歡迎轉(zhuǎn)載, 但請(qǐng)保留作者姓名和原文鏈接, 祝您進(jìn)步并共勉!???? |
            \********************************************/


            C++對(duì)象模型(10) - 3.2 Data Member Layout

            作者: Jerry Cat
            時(shí)間: 2006/11/15
            鏈接:?
            http://m.shnenglu.com/jerysun0818/archive/2006/11/15/15192.html


            3.2 Data Member Layout

            class Point3d {
            public:
            ?? // ...
            private:
            ?? float x;
            ?? static List<Point3d*> *freeList;
            ?? float y;
            ?? static const int chunkSize = 250;
            ?? float z;
            };
            the nonstatic data members are set down in the order of their declaration(按聲明的順序) within each class object (any intervening static data members, such as freeList and chunkSize, are ignored). In our example, then, each Point3d object consists of three float members in order: x, y, z. The static data members are stored in the program's data segment independent of individual class objects.

            The Standard requires within an access section (the private, public, or protected section of a class declaration) only that the members be set down such that "later members have higher addresses within a class object" (Section 9.2 of the Standard). That is, the members are not required to be set down contiguously.(可以不連續(xù)但必須從低到高)

            What might intervene between the declared members? Alignment constraints on the type of a succeeding member may require padding. This is true both of C and C++, and in this case, the member layout of the two languages is in current practice the same.(對(duì)齊)

            虛表指針在哪兒? Traditionally, it has been placed after all the explicitly declared members of the class. More recently, it has been placed at the beginning of the class object. The Standard, by phrasing the layout requirement as it does, allows the compiler the freedom to insert these internally generated members anywhere, even between those explicitly declared by the programmer.

            In practice, multiple access sections are concatenated together into one contiguous block in the order of declaration.編譯器幫你同類項(xiàng)合并 No overhead is incurred by the access section specifier or the number of access levels. For example, declaring eight members in one access section or eight separate access sections in practice results in the same-sized objects.

            posted on 2006-11-15 23:34 Jerry Cat 閱讀(995) 評(píng)論(0)  編輯 收藏 引用

            <2007年9月>
            2627282930311
            2345678
            9101112131415
            16171819202122
            23242526272829
            30123456

            常用鏈接

            留言簿(7)

            隨筆檔案

            最新隨筆

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            51久久夜色精品国产| 伊人久久大香线蕉精品不卡| 色综合久久久久网| 欧美无乱码久久久免费午夜一区二区三区中文字幕 | 久久免费视频6| 亚洲综合日韩久久成人AV| 久久91精品国产91久久麻豆| 最新久久免费视频| 久久综合久久综合久久综合| 久久久久久精品免费看SSS| 日韩亚洲欧美久久久www综合网 | 亚洲色大成网站WWW久久九九| 久久福利青草精品资源站免费| 久久99精品免费一区二区| 久久人人爽人人爽人人片av高请| 99久久免费国产精品| 久久久久亚洲av无码专区导航| 欧美久久天天综合香蕉伊| 亚洲欧美日韩精品久久| 久久精品国产亚洲av麻豆色欲| 久久无码专区国产精品发布| 99久久亚洲综合精品网站| 精品国产乱码久久久久久1区2区| 亚洲欧洲久久av| 久久精品国产亚洲Aⅴ蜜臀色欲| 精品国产福利久久久| 国产精品久久波多野结衣| 色妞色综合久久夜夜| 精品熟女少妇AV免费久久| 久久人人添人人爽添人人片牛牛| 久久久中文字幕日本| 久久久精品波多野结衣| 国産精品久久久久久久| 国内精品久久久久久久影视麻豆| 久久综合综合久久97色| 99久久99久久精品国产| 亚洲伊人久久大香线蕉苏妲己| 久久香蕉国产线看观看99| 一本大道加勒比久久综合| 久久精品成人| 亚洲国产成人精品女人久久久|