• <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

            ********************************************\
            |????歡迎轉載, 但請保留作者姓名和原文鏈接, 祝您進步并共勉!???? |
            \********************************************/


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

            作者: Jerry Cat
            時間: 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.(可以不連續但必須從低到高)

            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.(對齊)

            虛表指針在哪兒? 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.編譯器幫你同類項合并 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) 評論(0)  編輯 收藏 引用

            <2006年12月>
            262728293012
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            常用鏈接

            留言簿(7)

            隨筆檔案

            最新隨筆

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            欧洲人妻丰满av无码久久不卡| 无码人妻精品一区二区三区久久| 久久99国产综合精品免费| 久久99久国产麻精品66| 久久久久无码精品国产不卡| 蜜臀av性久久久久蜜臀aⅴ麻豆| 欧美黑人激情性久久| 91精品婷婷国产综合久久| 婷婷久久综合九色综合绿巨人| 综合网日日天干夜夜久久| 国产精品久久久久影院色| 久久精品无码一区二区日韩AV| 精品久久久无码21p发布| 久久精品国产影库免费看| 精品伊人久久久| 99久久精品免费观看国产| 亚洲精品无码久久一线| 久久国产精品一区| 97久久久精品综合88久久| 伊人久久五月天| 久久精品国产一区二区 | 久久久久无码中| 精品国产一区二区三区久久久狼 | 国内精品伊人久久久久AV影院| 理论片午午伦夜理片久久| 精品一区二区久久久久久久网站| 久久婷婷人人澡人人爽人人爱| 久久er国产精品免费观看8| 99久久免费国产精精品| 久久婷婷五月综合色奶水99啪| 一本一道久久a久久精品综合| 久久国产热这里只有精品| 99久久精品毛片免费播放| 国产产无码乱码精品久久鸭| 色8久久人人97超碰香蕉987| 久久精品极品盛宴观看| 亚洲国产精品狼友中文久久久| 久久精品国产福利国产琪琪| 精品久久久久久国产三级| 精品免费久久久久国产一区| 国产成人久久久精品二区三区 |