cpp-backend-reference icon indicating copy to clipboard operation
cpp-backend-reference copied to clipboard

构造函数中调用虚函数描述有问题

Open sniper00 opened this issue 7 years ago • 0 comments

在构造函数中调用虚函数,实际执行的是父类的对应函数,因为自己还没有构造好, 多态是被disable的。 

应该是 哪个类中调用,就执行的这个类对应的函数。其实 构造函数初始化列表 执行完毕,对象已经构造完成了。

sniper00 avatar Jul 04 '18 11:07 sniper00