阅读背景:

类工厂创建派生类c ++

来源:互联网 

I'm currently learning about class factory patterns with C++. I keep having errors while trying to implement the factory. Suppose I have an abstract class and two derived classes. What I want the factory to do is to create a new object of the base class like so: Ball *sc = new SoccerBall(); I am not sure on how to implement this, I have tried but of no avail. What do I need to fix?I'm currently learning about class factory patt




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: