VecDeque::operator[]

Subscript operators

Synopses

Declared in <util/vecdeque.h>

Get a mutable reference to the element in the deque at the given index. Requires idx < size().

T&
operator[](size_t idx) noexcept;
» more...

Get a const reference to the element in the deque at the given index. Requires idx < size().

T const&
operator[](size_t idx) const noexcept;
» more...

Return Value

  • A mutable reference to the element at idx.
  • A const reference to the element at idx.

Parameters

NameDescription
idxThe zero-based logical index of the element.