Why c++ vector needs to destroy elements in insert function, why not just shift them | SoloLearn: Learn to code for FREE!

+8

Why c++ vector needs to destroy elements in insert function, why not just shift them

6/1/2020 7:04:14 PM

🐉Tanay AKA Dragon 🐉

1 Answer

New Answer

+2

What do you mean by “destroy”? The elements are shifted as you said. The iterator however, is no longer valid.