2 Nov
2017
2 Nov
'17
5:55 p.m.
Den 26-10-2017 kl. 17:08 skrev Thorsten Ottosen via Boost:
Den 18-10-2017 kl. 16:37 skrev Joaquin M López Muñoz via Boost:
In my opinion, the best option is to do 1 or 2 depending on which of the two subsequences BB···B and FF···F is smaller (respectively), which minimizes the number of movements. This is consistent with the expected behavior for push_[back|front]. 3 always implies more movements.
Agreed, in a move-minimizing policy, one would want erase to do the least work.
There is one thing which might affect things for trivially copyable types I expect move() to be faster than move_backwards(). Just guessing though. -T