Skip to content

Documentation for VecDeque.insert is unclear #37046

Closed
@generalelectrix

Description

@generalelectrix

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions