I'm adding about 25,000 objects to a vector and it's taking too long so I wanted to try and speed it up. Currently I'm adding them in the format:
vector<MyClass> MyVector;
MyVector.push_back(MyClass(Param1, Param2, Parm3, Param4));
As I understand this would involve creating two instances of the object and copying one to the other. Is that correct?
Would it run quicker if I change the vector to pointers like this:
vector<MyClass*> MyVector;
MyVector.push_back(new MyClass(Param1, Param2, Parm3, Param4));
Thanks for any help you can offer.