instance creating instances

It’s called a factory and it looks something like: class Factory { Product create(int n); // … } class Product { // … } class Prod1 : public Product { // … } int main() { Factory factory = Factory(); Product prod[10] = factory.create(10); // … with create simply returning a Product object of some … Read more