I have this situation:
for(auto it = vec.rbegin(); it != vec.rend(); ++it)
{
if(condition(it))
{
//Move it at end;
break;
}
}
What is the most efficient/elegant way to move *it
at the end of vec
?
EDIT: *it
, not it
EDIT1: Now I use:
auto val = *it;
vec.erase((++it).base());
vec.push_back(val);
But I don't think is very efficient...