I want to be able to insert an element in the middle (or another place) in a vector without overwriting the existing element.
Say that my vector has 3 6 9 10, and I want to insert 7 right after 6. How can I do this without causing problems? This is a very rare operation, so effectiveness is not a problem here. In addition, at the moment I can not switch to another container (for example: std :: list), which is good for inserts in the middle.
Will the std::insertvector do what I want? How?
thanks
source
share