我有以下课程:
class gkLogicBrick
{
public:
gkLogicBrick(gkGameObject* object, gkLogicLink* link, const gkString& name);
virtual ~gkLogicBrick();
virtual gkLogicBrick* clone(gkLogicLink* link, gkGameObject* dest) = 0;
//unimportant function/variables
};
它的子类如下:
class gkLogicController : public gkLogicBrick
{
gkLogicController(gkGameObject* object, gkLogicLink* link, const gkString& name);
virtual ~gkLogicController() {}
//unimportant function/variables
};
命名的方法clone()
没有被覆盖,但它是从gkLogicController
对象上的另一个类调用的。我以为不允许调用纯虚函数?C++ 编译器是否会自动为任何继承的纯虚函数创建默认定义?