It may be a bit confusing, but...
Let's say I have a vector type member in a class, something like vector<Operator*>
( I have methods on my class to return Operators from this container).
Now lets say that I have a method on my class that receives an Operator object op
and inserts it on the vector. What I want to know is: will I have any trouble by insert it directly into the vector (push_back(&op)
)? Or should I use the copy constructor to create a new Operator and then put this new one on the vector (with push_back(new Operator(op)))?
(Operator is a class I created)