c++ - 不带多态性的抽象基类

标签 c++ inheritance interface polymorphism

为什么你会有一个抽象基类为一个只有一个(永远永远)派生类的库定义接口(interface)?

最佳答案

您可能希望将实现换成单元测试之类的东西

关于c++ - 不带多态性的抽象基类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6255984/

相关文章:

c++ - 如何为 Visual Studio C++ 项目重新生成包目录?

c++ - 可以延长初始化列表中对象的生命周期吗?

ios - 对象 C : Can't inherit public property from parent class in child class

c++ - 链接 boost - 对 `boost::serialization::singleton_module::get_lock()' 的 undefined reference

c++ - 复杂模板类型名称的别名

c++ - 修改 std::vector 函数(继承?)

python - 如果在 Pyramid 中配置了一个类的 View ,是否可以使用为父类(super class)配置的 View ?

c# - 一个方法可以实现多个接口(interface)方法吗?

iphone - setStatusBarOrientation 在 iOS8 中导致问题

delphi - 在 Delphi 中使用泛型与属性接口(interface)