You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The DevCom-216960 reporter suggested that inserting to the middle of deque can be accomplished by inserting a move'd new first/last element to begin/end, and then moveing elements further, and finally emplacing the destination element to move'd-out place.
It is faster than using rotate.
It is still O(N), but it is expected to execute faster.
Reporter's code uses std::move by default, but for string-like classes it uses swap.
Additional context
This item was originally reprted on Developer Community as DevCom-216960 and is also tracked by Microsoft-internal VSO-586319 / AB#586319.
The text was updated successfully, but these errors were encountered:
The current implementation using rotate seems non-conforming - rotate relies on ADL-swap, but the standard doesn't require Cpp17Swappable/Cpp17ValueSwappable for single-element insert/emplace.
Describe the bug
The DevCom-216960 reporter suggested that inserting to the middle of
deque
can be accomplished by inserting amove
'd new first/last element to begin/end, and thenmove
ing elements further, and finally emplacing the destination element tomove
'd-out place.It is faster than using
rotate
.It is still O(N), but it is expected to execute faster.
Reporter's code uses
std::move
by default, but for string-like classes it usesswap
.Reporter's code sample
Additional context
This item was originally reprted on Developer Community as DevCom-216960 and is also tracked by Microsoft-internal VSO-586319 / AB#586319.
The text was updated successfully, but these errors were encountered: