Question PRG-CPP-0079
HardWhen does iterator invalidation happen with std::vector?
- A.
Never
- B.
Only when the vector is destroyed
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
C++ question
When does iterator invalidation happen with std::vector?
Never
Only when the vector is destroyed
Sign up free to see the answer and a step-by-step explanation.
When an insertion causes reallocation, or for elements at or after an erased position
On every read