• <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>
            posts - 9, comments - 0, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理
            1, Declare destructors virtual in polymorphic base classes
            why ? because C++ specifies that when a derived class object is deleted through a pointer to a base class with a non-virtual destructor, results are undefined.What typically happens at runtime is that the derived part of the object is never destroyed

            2, if a class is not intended to be a base class, making the destructor virtual is usually a bad idea. 
            why?  if a class have virtual functions, it has extra overhead(vptr).

            3, In fact, many people summarize the situation this way: declare a virtual destructor in a class if and only if that class contains at least one virtual function

            4,Sometimes, however, you have a class that you'd like to be abstract, but you don't have any pure virtual functions.
            solution: declare pure virtual destructor.
            There is one twist, however you must provide a definition for the pure virtual destructor, or linker will complain.

            5, Not all base classes are designed to be used polymorphically. Neither the standard string type, for example, nor the STL container typesare designed to be base classes at all, much less polymorphic ones.


             
             
            精品久久久久久久国产潘金莲 | 日本加勒比久久精品| 国产呻吟久久久久久久92| 久久99亚洲综合精品首页| 77777亚洲午夜久久多喷| 久久99国产精品99久久| 中文精品99久久国产| 国产精品久久一区二区三区| 亚洲成av人片不卡无码久久| 精品久久久久久久无码| 久久久久久国产a免费观看黄色大片 | 精品久久无码中文字幕| 色偷偷88欧美精品久久久| 国产精品久久久久…| 久久午夜夜伦鲁鲁片免费无码影视 | 一本色综合久久| 精品综合久久久久久88小说| 久久精品亚洲精品国产色婷 | AA级片免费看视频久久| 精品久久久久久国产潘金莲| 99精品久久久久久久婷婷| 无码任你躁久久久久久久| 亚洲伊人久久大香线蕉苏妲己| 亚洲AV无码久久精品蜜桃| 国产精品99久久久精品无码| 久久精品无码一区二区app| 欧美一区二区精品久久| 91精品国产高清91久久久久久| 亚洲精品美女久久久久99| 欧美成人免费观看久久| 久久久久国产一区二区三区| 久久99精品国产麻豆不卡| 国内精品久久久久久久影视麻豆| 一本久久久久久久| 激情综合色综合久久综合| 精品久久综合1区2区3区激情| 伊人色综合久久天天| 国产精品亚洲美女久久久| 久久久久亚洲AV成人网人人软件| 久久九九久精品国产免费直播| 久久久久国产视频电影|