I want to move first element of vector to the end of vector.
v = {1,2,3,4} after this should be like this
v= {2,3,4,1}
my compiler version is gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
I know in Vc11 we can use std::move to move element. but how can I do this in above version of compiler?
std::rotate.std::movedoes not move things in that sense. Anyway, there are good examples here:std::rotate.std::dequewould be more appropriate of this.remove(v.begin(), v.end(), v.at(0))if there are no duplicates. I wouldn't do that, but... funnily enough. :)dequehas efficientpop_front()/push_front()besides the*_back()variants, only available invector.