问题描述
假设我们有一个简单的继承结构。两个类继承自同一接口:
接口接口
我将跳过BaSEOne和BaseTwo标头。
//interface.h
class Interface {
static Interface* Handle();
void Foo() = 0; // Interface class is an abstract one
};
//base_one.cc
Interface* Interface::Handle() {/*implementation*/}
//base_two.cc
Interface* Interface::Handle() {/*different implementation*/}
现在在我们的主文件中,我们调用Interface :: Handle();
//main.cc
#include "interface.h"
int main() {
Interface* = Interface::Handle();
}
问题:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)