• <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 閱讀(418) 評論(0)  編輯 收藏 引用 所屬分類: C++ programme language設計模式
            日本久久久久久中文字幕| 国产AV影片久久久久久| 2021国内久久精品| 久久精品人人做人人爽97| 久久精品国产亚洲综合色| 看全色黄大色大片免费久久久| 香蕉久久夜色精品国产尤物| 久久久久无码精品国产| 国产99久久久国产精品~~牛| 久久精品国产99国产精品导航| 一本大道加勒比久久综合| 久久久久亚洲AV无码专区首JN| 久久精品国产亚洲欧美| 色婷婷综合久久久中文字幕| 久久99精品九九九久久婷婷| 色88久久久久高潮综合影院| 久久久久国产精品三级网| 久久久精品人妻一区二区三区蜜桃| 久久精品中文字幕一区| 久久精品国产91久久综合麻豆自制| 蜜桃麻豆www久久国产精品| 欧美日韩中文字幕久久伊人| 漂亮人妻被中出中文字幕久久| 久久艹国产| 国产综合精品久久亚洲| 精品久久777| 精品久久香蕉国产线看观看亚洲| 色欲久久久天天天综合网| 亚洲欧洲精品成人久久奇米网| 久久精品无码av| 久久精品无码一区二区日韩AV| 精品国产91久久久久久久a| 亚洲狠狠综合久久| 国产免费久久精品99久久| 久久se这里只有精品| 久久九九免费高清视频| 久久精品国产亚洲5555| 久久久久九国产精品| 伊人热热久久原色播放www| 久久精品国产男包| 精品免费久久久久久久|