Pure virtual invocation from constructor and destructor
问题 The C++ standard says that invoking a pure virtual function from a constructor or destructor is forbidden. What is the reason for this? Why should the standard place a restriction like this? 回答1: At the point a class destructor is run, all subclass destructors have already been run. It would not be valid to call a virtual method defined by a subclass, for which its destructor has already run. A similar restriction exists around calling virtual methods in constructors. You can't call a virtual