• <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 閱讀(406) 評論(0)  編輯 收藏 引用 所屬分類: C++ programme language設計模式
            久久婷婷是五月综合色狠狠| 99热都是精品久久久久久| 久久青青草原精品国产不卡| 久久国产午夜精品一区二区三区| 久久久精品国产Sm最大网站| 亚洲综合久久夜AV | 亚洲中文字幕无码久久2017 | 怡红院日本一道日本久久| 亚洲午夜久久影院| 国产精品中文久久久久久久| 亚洲AV日韩AV天堂久久| 国产精品久久久久一区二区三区 | 亚洲国产精品无码久久久秋霞2| 久久精品国产亚洲AV无码偷窥| 亚洲一本综合久久| 97久久国产露脸精品国产| 国产成人精品久久亚洲| 色综合久久无码五十路人妻| 久久99精品国产麻豆婷婷| 一本色道久久88精品综合| 伊人久久大香线蕉影院95| 欧美午夜A∨大片久久 | 亚洲国产精品无码久久久秋霞2 | 久久伊人影视| 蜜桃麻豆www久久| 久久精品国产乱子伦| 久久亚洲欧洲国产综合| 精品国产91久久久久久久a| 久久精品亚洲中文字幕无码麻豆| 性高湖久久久久久久久AAAAA | 久久丫精品国产亚洲av| 久久午夜福利无码1000合集| 久久综合九色综合久99| 久久久久国产视频电影| 国内精品久久久久久久久 | 国内精品九九久久久精品| 久久中文字幕精品| 一本色道久久综合| 久久无码AV中文出轨人妻| 久久免费国产精品| 久久青青草原精品国产软件|