I need to insert values into the beginning of a std::vector and I need other values in this vector to be pushed to further positions for example: something adde
std::vector
You may try this
vector v={1,2,3,4,5}; for(int i=0;i<5;i++){ v.insert(v.begin(),i+1); }
Output is {5,4,3,2,1,1,2,3,4,5}
Every element is shifted to the right after insertion