Skip to content

VecDeque docs should mention in which direction indices go #34920

Closed
@hanna-kruppe

Description

@hanna-kruppe

It's not clear to me whether index 0 is the front or the back of the deque. For example, the std::collections::vec_deque module docs only say "It also has O(1) indexing like a vector." and the documentation of VecDeque::get only states "Retrieves an element in the VecDeque by index." and the example retrieves the middle element of a three-element deque. From the iteration order, or the example in swap, I can infer that it's from the front (and of course I could try it out) but it's would have saved me some time if it was just stated up-front in the relevant locations.

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