随笔 - 3  文章 - 0  trackbacks - 0

留言簿

随笔分类

随笔档案

要记得经常点击我哦

搜索

  •  

最新评论

阅读排行榜

评论排行榜

转载:http://www.artima.com/cppsource/pure_virtual.html
When you construct an instance of a derived class, what happens, exactly? If the class has a vtbl, the process goes something like the following:

Step 1: Construct the top-level base part:.

  1. Make the instance point to the base class's vtbl.
  2. Construct the base class instance member variables.
  3. Execute the body of the base class constructor.

 

Step 2: Construct the derived part(s) (recursively):

  1. Make the instance point to the derived class's vtbl.
  2. Construct the derived class instance member variables.
  3. Execute the body of the derived class constructor.

 

Destruction happens in reverse order, something like this:

Step 1: Destruct the derived part:

  1. (The instance already points to the derived class's vtbl.)
  2. Execute the body of the derived class destructor.
  3. Destruct the derived class instance member variables.

 

Step 2: Destruct the base part(s) (recursively):

  1. Make the instance point to the base class's vtbl.
  2. Execute the body of the base class destructor.
  3. Destruct the base class instance member variables.
posted @ 2010-08-16 18:57 Uniker 阅读(1409) | 评论 (0)编辑 收藏

问题描述:在编译的时候出现__none_rtti_object异常

解决方法:
编译器开启支持运行时刻识别/GR,/GR(启用运行时类型信息)
Vs2003 如何打开C++的RTTI机制
说明:此选项 (/GR) 添加代码以便在运行时检查对象类型。当指定此选项时,编译器定义 _CPPRTTI 预处理器宏。默认情况下,此选项被清除 (/GR–)。
在 Visual Studio 开发环境中设置此编译器选项
   1. 打开此项目的“属性页”对话框。
   2. 单击“C/C++”文件夹。
   3. 单击“语言”属性页。
   4. 修改“启用运行时类型信息”属性。

posted @ 2010-06-21 14:45 Uniker 阅读(1100) | 评论 (0)编辑 收藏
       终于有了自己的技术博客了,以往写代码的时候总是有一些问题解决了就没有记录下来,后来重新碰到此类问题又得重头开始解决,很是恼火。希望在以后的开发中能够将所学、所感能够记录于此。
       同时希望能够与大家同进步
posted @ 2010-03-31 11:15 Uniker 阅读(176) | 评论 (0)编辑 收藏
仅列出标题