• <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 閱讀(405) 評(píng)論(0)  編輯 收藏 引用 所屬分類: C++ programme language設(shè)計(jì)模式
            久久久青草久久久青草| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 亚洲日韩欧美一区久久久久我 | 久久精品亚洲乱码伦伦中文 | 丁香五月网久久综合| 国产L精品国产亚洲区久久| 一本久久综合亚洲鲁鲁五月天| 国产精品久久久久久久人人看| www.久久99| 日韩人妻无码一区二区三区久久99| 一本久久a久久精品亚洲| 亚洲午夜精品久久久久久人妖| 日韩久久久久中文字幕人妻| 色欲久久久天天天综合网精品| 国产L精品国产亚洲区久久| 无码国内精品久久人妻| 热久久视久久精品18| 亚洲综合精品香蕉久久网97| 久久免费看黄a级毛片| 久久高潮一级毛片免费| 精品久久香蕉国产线看观看亚洲 | 久久久久亚洲AV无码观看| 99精品久久久久久久婷婷| 亚洲国产欧洲综合997久久| 狠狠人妻久久久久久综合| 久久人人爽人人爽人人片AV不 | 久久经典免费视频| 国产成人久久777777| 久久精品国产亚洲欧美| 亚洲成色www久久网站夜月| 开心久久婷婷综合中文字幕| 激情久久久久久久久久| 91久久精一区二区三区大全| 亚洲AV无码久久| 欧美一区二区三区久久综| 一本色综合网久久| 久久久久久国产精品无码下载| 久久久久久久综合狠狠综合| 久久亚洲欧洲国产综合| 日韩美女18网站久久精品| 亚洲欧美成人久久综合中文网|