Vote count:
0
What is the most efficient way to move an item in a vector from lets say 4th position to 2nd position.The vector in this case can contain more than 100 elements.The algorithm for moving elements should be based on iterators or the indexes (meaning find the 4 the element(source) and 2nd element(destination) ),which one is better.I already tried based on indexes (What is the most effective way to move items within a vector? in my case getting the iterator for 4th and 2nd position is easier than to calculate the indexes.
asked 35 secs ago
Moving an item in a vector
Aucun commentaire:
Enregistrer un commentaire