Closed
Description
The documentation for VecDeque.insert describes implementation details of how it internally rearranges the data structure which make it unclear on what the actual behavior of the method call is:
"Inserts an element at index within the VecDeque. Whichever end is closer to the insertion point will be moved to make room, and all the affected elements will be moved to new positions.
Element at index 0 is the front of the queue."
The doc should clearly state that the element will be inserted at this index and the existing element at this index will be pushed towards the back of the deque. The current doc makes it sound like which direction the existing element will be pushed towards could be different depending on that implementation detail.
Metadata
Metadata
Assignees
Labels
No labels