• <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ì)模式
            无码任你躁久久久久久老妇| 久久精品国产一区二区| 久久久久久久亚洲精品| 国内精品久久久久久久久电影网| 精品久久综合1区2区3区激情| 久久国产精品视频| 伊人久久综合成人网| 日本精品久久久久中文字幕| 久久天天躁狠狠躁夜夜2020老熟妇| 久久精品国产亚洲av高清漫画 | 国产产无码乱码精品久久鸭| 色综合久久88色综合天天 | 无码精品久久久久久人妻中字| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 精品久久久久久中文字幕大豆网| 一本久久久久久久| 国产精品天天影视久久综合网| 99久久国产精品免费一区二区 | 亚洲伊人久久大香线蕉综合图片| 91亚洲国产成人久久精品网址| 久久亚洲中文字幕精品一区| 热RE99久久精品国产66热| 久久综合精品国产二区无码| 婷婷五月深深久久精品| 久久99精品久久久久久不卡| 国产精品一区二区久久国产| 精品国产乱码久久久久软件| 色综合合久久天天给综看| 久久se精品一区精品二区国产| 久久精品国产免费一区| 亚洲午夜精品久久久久久人妖| 久久国产精品无码一区二区三区 | 97久久精品国产精品青草| 亚洲午夜无码久久久久| 久久精品国产男包| 精品久久人人爽天天玩人人妻| 久久久久久久久66精品片| 久久综合鬼色88久久精品综合自在自线噜噜 | 精品久久久久久无码不卡| 人妻少妇精品久久| 2021国产精品午夜久久|