当前在线人数14053
首页 - 分类讨论区 - 电脑网络 - 葵花宝典版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:Re: VC里面的stl支持是不是很弱?
[同主题阅读] [版面: 葵花宝典] [作者:thrust] , 2004年07月14日17:09:41
thrust
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: thrust (哼哼的多隆猪), 信区: Programming
标  题: Re: VC里面的stl支持是不是很弱?
发信站: Unknown Space - 未名空间 (Wed Jul 14 17:10:35 2004), 转信


【 在 observer (笑看人生) 的大作中提到: 】
: Thanks for replying.
: I checked the books and the right way is:
: template <class T>
: PointGeneric3D<T>::PointGeneric3D(const T xx, const T yy, const T zz)
: : z(zz), PointGeneric<T>(xx, yy)
the good way is to reverse the order, because base class ctors are
always initialized first, no matter in what order did you write them
: {
: }
: I know virtual functions, just don't remember so many details as you do.
: Thank you all for clear this confusion for me.
: 【 在 thrust (哼哼的多隆猪) 的大作中提到: 】
: : vptr and vtbl is the basis of the whole virtual function system,
: : I assume you know it...
: : I know you wanted to call that! And I thought you know how to call that...
: : your way of calling base class ctor is INCORRECT and initializer should
: : be used. And initializer CAN be used to call ctor with parameter, just
: : write the parameter down, what do you expect... and pptwo already showed
: : you how to do that.
: : it probably looks fine, but it is incorrect, period.
: : base class ctor with parameter should not be called explicitly, EITHER!
: : ctors should almost never be called explicitly. (except that you do the
: : allocation and initialize separately, but that's rarely used.)


--
贵姓阿你? 多隆哪有你这么帅阿?

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 128.205.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996