• <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設計模式
            综合久久给合久久狠狠狠97色| 久久99热只有频精品8| 日韩美女18网站久久精品| 国产精品乱码久久久久久软件| 亚洲欧美日韩中文久久| 日本久久久精品中文字幕| 亚洲午夜无码久久久久小说| 久久99免费视频| 国产成人精品三上悠亚久久| 久久久久国产精品| 久久精品国产亚洲av麻豆图片| 99久久无码一区人妻| 亚洲AV无码成人网站久久精品大| 久久99精品久久久久久水蜜桃| 一本久久a久久精品亚洲| 欧美无乱码久久久免费午夜一区二区三区中文字幕 | 亚洲va中文字幕无码久久| 国内精品久久久久久不卡影院| 热re99久久6国产精品免费| 久久久国产视频| 午夜福利91久久福利| 欧美久久亚洲精品| 欧美国产精品久久高清| 国产 亚洲 欧美 另类 久久| 丁香狠狠色婷婷久久综合| 久久久久久无码Av成人影院| 久久AV高潮AV无码AV| 久久青青色综合| 久久久久久精品成人免费图片| 性欧美大战久久久久久久 | 久久久久久久综合狠狠综合| 久久九九免费高清视频| 国产成人精品久久| 久久精品成人免费观看97| 久久综合狠狠综合久久激情 | 女人香蕉久久**毛片精品| 久久国产三级无码一区二区| 久久精品国产第一区二区| 亚洲精品第一综合99久久| 欧美久久久久久| 久久A级毛片免费观看|