• <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.


             
             
            久久久久久久精品妇女99| 亚洲AⅤ优女AV综合久久久| 国产99久久精品一区二区| 精品久久久久久综合日本| 国产精品VIDEOSSEX久久发布| 久久综合九色综合欧美就去吻| 久久久久亚洲国产| 精品久久久久香蕉网| 久久精品女人天堂AV麻| 亚洲精品美女久久久久99| 日韩精品久久久久久| 久久午夜福利无码1000合集| 久久婷婷久久一区二区三区| 国产精品亚洲综合久久| 99久久国产主播综合精品| 久久狠狠高潮亚洲精品| 无码精品久久一区二区三区| 欧美综合天天夜夜久久| 亚洲精品乱码久久久久久蜜桃图片| 国产精品99久久久久久董美香| 久久久久亚洲精品无码蜜桃| 狠狠色丁香久久婷婷综合_中 | 亚洲人成精品久久久久| 伊人丁香狠狠色综合久久| 久久人人爽人人爽人人AV | 久久久免费精品re6| 中文精品99久久国产| 国产精品久久久久乳精品爆| 久久99精品久久只有精品| 国内精品伊人久久久久av一坑| 久久亚洲AV成人无码软件| 久久久久亚洲?V成人无码| 久久精品国产亚洲7777| 久久久免费观成人影院| 国产成人久久777777| 亚洲国产成人久久精品动漫| 93精91精品国产综合久久香蕉 | 久久婷婷成人综合色综合| 久久99这里只有精品国产| 久久久久久午夜精品| 伊人久久大香线焦AV综合影院|