• <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>
            Classes that satisfy certain conditions are allowed, but not required, to end with an Interface suffix.
            link

            Definition:

            A class is a pure interface if it meets the following requirements:

            • It has only public pure virtual ("= 0") methods and static methods (but see below for destructor).
            • It may not have non-static data members.
            • It need not have any constructors defined. If a constructor is provided, it must take no arguments and it must be protected.
            • If it is a subclass, it may only be derived from classes that satisfy these conditions and are tagged with the Interface suffix.

            An interface class can never be directly instantiated because of the pure virtual method(s) it declares. To make sure all implementations of the interface can be destroyed correctly, they must also declare a virtual destructor (in an exception to the first rule, this should not be pure). See Stroustrup, The C++ Programming Language, 3rd edition, section 12.4 for details.

            Pros: Tagging a class with the Interface suffix lets others know that they must not add implemented methods or non static data members. This is particularly important in the case of multiple inheritance. Additionally, the interface concept is already well-understood by Java programmers.

            Cons: The Interface suffix lengthens the class name, which can make it harder to read and understand. Also, the interface property may be considered an implementation detail that shouldn't be exposed to clients.

            Decision: A class may end with Interface only if it meets the above requirements. We do not require the converse, however: classes that meet the above requirements are not required to end with Interface.


            Posted on 2008-10-07 14:39 micheal's tech 閱讀(410) 評(píng)論(0)  編輯 收藏 引用 所屬分類: C++ programme language設(shè)計(jì)模式
            日本欧美国产精品第一页久久| 一本一本久久a久久综合精品蜜桃| 一本久久a久久精品综合香蕉| 久久亚洲欧洲国产综合| 久久婷婷五月综合色奶水99啪 | 精品国产乱码久久久久久郑州公司 | 一本色道久久88综合日韩精品| 99久久精品国产一区二区| 久久婷婷国产综合精品| 大美女久久久久久j久久| 久久99精品国产麻豆宅宅| 国产V综合V亚洲欧美久久| 国产精品伊人久久伊人电影| 狠狠色噜噜色狠狠狠综合久久| 伊人久久大香线蕉精品| 久久这里只有精品18| 久久免费视频一区| 97久久天天综合色天天综合色hd| 精品久久久久久久国产潘金莲| 国产精品对白刺激久久久| 久久99这里只有精品国产| 99久久精品免费| 国产精品久久久久影院色 | 性色欲网站人妻丰满中文久久不卡| 久久精品视频91| 久久久噜噜噜久久中文字幕色伊伊| 欧美牲交A欧牲交aⅴ久久 | 亚洲狠狠婷婷综合久久蜜芽| 久久精品国产精品亚洲下载| 996久久国产精品线观看| 久久精品人人做人人爽97 | 国产叼嘿久久精品久久| 国产精品久久99| 精品人妻久久久久久888| 久久精品欧美日韩精品| 亚洲AV无码1区2区久久| 中文字幕热久久久久久久| 久久久久久精品成人免费图片| 伊人久久大香线蕉综合5g| 国产精品久久久久a影院| 亚洲欧美精品一区久久中文字幕|