For some reason, I have a vector of pointer of struct, I would like to assign new space to every block of the vector. But I don't want to do it in a loop for every block as it may slow the whole process. Is there a faster way to do it? Could anyone provide me a solution with code?
This is what I current doing("pool" is the struct name):
vector<pool*> poolPointer(vectorSize);
for(int i = 0; i<poolPointer.size() ;i++){
poolPointer.at(i) = new pool;}
I think it is very slow thus I would like to search for a faster way to allocate space and return point of struct to each individual block in the vector.