Maybe just change the data structure. Might as well have regular array with a max # of enemies, therefore no need for dynamic allocation of the vector.
vector has an under the hood capacity - can reserver memory by calling reserve function. So I can reserve like 50 enemies, then no dynamic allocation until that point.
Maybe just change the data structure. Might as well have regular array with a max # of enemies, therefore no need for dynamic allocation of the vector.
Go for std::array