Import std.collections.deque
std.collections.deque
Deque<T>: values added and taken at either end. Front holds the first values backwards, so
both ends are at the end of an array, and when one side runs out as values are taken, it takes
half of the other.
std/collections/deque.fb
Types
Deque
class
@DebugElements Public Class Deque<T> Implements Iterable<T>, Cloneable, Defaultable
A double-ended queue: values go on and come off at either end.
std/collections/deque.fb, line 9
-
How many values it holds.
-
Puts
valueat the front. A Deque holds at most 2147483647 values, as many as its Int Count counts, as an array does, and one more panics. -
Puts
valueat the back. A Deque holds at most 2147483647 values, as many as its Int Count counts, as an array does, and one more panics. -
The same as AddLast.
-
Adds each of the
valueslast, in order. -
Takes the first value off and gives it. Panics when the Deque is empty.
-
Takes the last value off and gives it. Panics when the Deque is empty.
-
The first value, which stays, as everything else does. Panics when the Deque is empty.
-
The last value, which stays, as everything else does. Panics when the Deque is empty.
-
Takes the first value off and gives it, or Null when the Deque is empty.
-
Takes the last value off and gives it, or Null when the Deque is empty.
-
The first value, which stays, or Null when the Deque is empty.
-
The last value, which stays, or Null when the Deque is empty.
-
The value at index, counting from the first, which is 0. Panics unless index is from 0 to Count minus 1.
-
Gives the value at index, counting from the first, a new value. Panics unless index is from 0 to Count minus 1.
-
Whether it holds
value. -
The values from first to last, in a new array.
-
Takes every value out.
-
A new, empty Deque.
-
A new Deque with the same values.
-
The values from first to last. Adding or removing a value while going over them panics.
DequeIterator
struct
Public Struct DequeIterator<T> Implements Iterator<T>
Front's values backwards from FrontLeft, then Back's from BackAt on.
std/collections/deque.fb, line 205
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
Report an issue with this page or with FutureBlitz on GitHub.