﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-fatemaster-文章分类-网摘</title><link>http://www.cppblog.com/guevara/category/9921.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 22 Mar 2009 13:31:27 GMT</lastBuildDate><pubDate>Sun, 22 Mar 2009 13:31:27 GMT</pubDate><ttl>60</ttl><item><title>虚函数与构造函数、析构函数</title><link>http://www.cppblog.com/guevara/articles/77360.html</link><dc:creator>fatemaster</dc:creator><author>fatemaster</author><pubDate>Fri, 20 Mar 2009 15:55:00 GMT</pubDate><guid>http://www.cppblog.com/guevara/articles/77360.html</guid><wfw:comment>http://www.cppblog.com/guevara/comments/77360.html</wfw:comment><comments>http://www.cppblog.com/guevara/articles/77360.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guevara/comments/commentRss/77360.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guevara/services/trackbacks/77360.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1、构造函数能不能是虚函数：&nbsp;1.1从存储空间角度虚函数对应一个vtable，这大家都知道，可是这个vtable其实是存储在对象的内存空间的。问题出来了，如果构造函数是虚的，就需要通过&nbsp;vtable来调用，可是对象还没有实例化，也就是内存空间还没有，怎么找vtable呢？所以构造函数不能是虚函数。1.2从使用角度虚函数主要用于在信息不全的情况下，能使重载的函数得...&nbsp;&nbsp;<a href='http://www.cppblog.com/guevara/articles/77360.html'>阅读全文</a><img src ="http://www.cppblog.com/guevara/aggbug/77360.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guevara/" target="_blank">fatemaster</a> 2009-03-20 23:55 <a href="http://www.cppblog.com/guevara/articles/77360.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>