【发布时间】:2014-08-21 09:14:40
【问题描述】:
我有以下几点:
class Abstract
{
virtual void AbstractMethod() = 0;
};
class Implementer
{
void AbstractMethod() {};
};
class Concrete : public Abstract, private Implementer
{};
我无法实例化Concrete,因为纯虚方法AbstractMethod 未被覆盖。我做错了什么?
【问题讨论】:
-
你为什么不在实现者中从 Abstract 继承?
-
@Cogwheel - 在我看来,它更清楚地表达了我正在尝试使用的概念
-
其实我觉得真的是这个的翻版:stackoverflow.com/q/23153328/103167
标签: c++ inheritance multiple-inheritance pure-virtual private-inheritance