• <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ì)模式
            热RE99久久精品国产66热| 中文字幕精品无码久久久久久3D日动漫 | 久久久久亚洲AV无码专区桃色| 精品人妻伦一二三区久久| 久久精品成人免费观看97| 久久久久99这里有精品10| 99久久精品午夜一区二区| 久久播电影网| 精品人妻久久久久久888| 色综合色天天久久婷婷基地| 无码任你躁久久久久久老妇| 成人资源影音先锋久久资源网| 91精品国产综合久久香蕉| 久久综合视频网| 97精品伊人久久久大香线蕉| 狠狠精品久久久无码中文字幕| 精品国际久久久久999波多野| 久久久久国产精品麻豆AR影院| 99久久夜色精品国产网站| 久久婷婷五月综合色99啪ak| 久久九九精品99国产精品| 久久天天躁夜夜躁狠狠躁2022| www久久久天天com| 亚洲AV成人无码久久精品老人| 香蕉aa三级久久毛片| 久久青草国产手机看片福利盒子| 亚洲色欲久久久综合网东京热| 久久亚洲精品国产精品婷婷 | 色狠狠久久AV五月综合| 性做久久久久久久久久久| 久久99国产一区二区三区| 久久99毛片免费观看不卡 | 日本久久中文字幕| 久久精品成人一区二区三区| 国产成人精品久久亚洲| 国产成人精品久久亚洲高清不卡 | 99久久精品国产高清一区二区| 99久久99久久精品免费看蜜桃| 狠狠色丁香久久婷婷综合五月| 久久成人精品视频| 91亚洲国产成人久久精品|