• <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ì)模式
            26uuu久久五月天| 精品国产VA久久久久久久冰| 久久精品aⅴ无码中文字字幕不卡| 精品国产青草久久久久福利| 久久精品国产99国产精偷| 一本色道久久综合狠狠躁| 久久天天躁夜夜躁狠狠| 久久无码高潮喷水| 久久天天躁狠狠躁夜夜av浪潮| 国产L精品国产亚洲区久久| 久久国产亚洲精品麻豆| 国产激情久久久久影院老熟女免费| 久久精品国产亚洲av水果派| 国产精品久久99| 嫩草影院久久99| 久久久久久久久久久免费精品 | 久久99热这里只频精品6| 亚洲欧美成人久久综合中文网 | 久久久久成人精品无码中文字幕| 伊人久久大香线蕉亚洲| 国产精品久久久久国产A级| 蜜桃麻豆www久久| 久久夜色撩人精品国产| 亚洲va久久久噜噜噜久久天堂| 久久无码人妻一区二区三区| 久久综合九色综合97_久久久| 97精品国产97久久久久久免费| 久久免费国产精品| 亚洲AV无码久久精品成人 | 国产一区二区精品久久| 国产精品欧美亚洲韩国日本久久| 久久精品成人欧美大片| 7777久久久国产精品消防器材| 久久人人爽人人爽人人AV| 国产日韩欧美久久| 久久久久久久久久久久久久| 精品久久久久久亚洲| 久久亚洲AV无码精品色午夜| 久久狠狠色狠狠色综合| 人妻无码精品久久亚瑟影视| 99国产欧美精品久久久蜜芽 |