• <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++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
            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.


             
             
            日韩欧美亚洲综合久久影院Ds | 久久久久亚洲AV无码永不| 国产69精品久久久久99尤物| 日本福利片国产午夜久久| 人人狠狠综合久久亚洲婷婷| 久久99国产精品久久99| 久久亚洲AV无码精品色午夜| 久久久女人与动物群交毛片 | 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 手机看片久久高清国产日韩 | 久久本道综合久久伊人| 97香蕉久久夜色精品国产| 久久久久人妻精品一区二区三区 | 久久久久久精品免费免费自慰 | 久久精品国产精品亚洲| 97久久久久人妻精品专区| 久久久精品人妻一区二区三区蜜桃 | 久久99国产精品久久| 久久福利资源国产精品999| 久久九九青青国产精品| 中文字幕人妻色偷偷久久| 日韩十八禁一区二区久久 | 亚洲国产欧洲综合997久久| 久久99精品免费一区二区| 亚洲精品tv久久久久久久久| 日韩欧美亚洲国产精品字幕久久久| 久久天堂AV综合合色蜜桃网| 中文字幕久久久久人妻| 久久青青草原亚洲av无码| 日本加勒比久久精品| 亚洲国产精品婷婷久久| 久久e热在这里只有国产中文精品99| 一本久久a久久精品亚洲| 久久人妻无码中文字幕| 九九精品久久久久久噜噜| AV色综合久久天堂AV色综合在 | 久久精品国产亚洲AV高清热 | 久久精品国产亚洲5555| 久久亚洲精品视频| 久久―日本道色综合久久| 国产成人综合久久久久久|