size and copy all elements in the new one?
Yep.. Thats what happens internally.. To be more precise it allocates a specific sized array already, when you push items on the vector it will just increase its internal counter and when the internal array is full.. It allocates new array with double the size then copies all the elements to the new array.
Обсуждают сегодня