Skip to content

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

Description

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions