There is a class in our code, say class C. I want to create a vector of objects of class C. However, both the copy constructor and assignment operator are purposely declared to be private. I don’t want to (and perhaps am not allowed) to change that.
Is there any other clean way to use/define vector<C> ?
You could use a
vector<C*>orvector<shared_ptr<C>>instead.