基类的构造函数不会被子类继承!!!

来源:互联网 发布:手机防沉迷软件 编辑:程序博客网 时间:2024/04/28 12:30

引自:MSDN

Constructors of base classes are not inherited by derived classes. When an object of derived class type is created, it is constructed starting with the base class components; then it moves to the derived class components. The compiler uses each base class’s constructor as that part of the complete object is initialized (except in cases of virtual derivation, as described inInitializing Base Classes).

原创粉丝点击