Skip to content

Std collections deque

std:std.collections.Deque

Class Deque Implements IContainer#

The Deque class.

A deque is a 'double ended queue' (usually pronounced 'deck').

You can efficiently add items to either end of a deque using AddFirst and AddLast, and remove items using RemoveFirst and RemoveLast.

Deques implement the IContainer interface so can be used with Eachin loops.

Note that you should NOT modify a deque while iterating through it with an eachin loop. Doing so while cause a 'concurrent deque modification' runtime error in debug mode. Please see IContainer for more information.

Structs
Iterator The Deque.Iterator struct.
Constructors
New Creates a new deque.
Properties
Capacity Gets the storage capacity of the deque. (read only)
Data Gets the underlying array used by the deque. (read only)
Empty True if deque is empty. (read only)
Length Gets the number of values in the deque. (read only)
Methods
AddFirst Adds a value at the start of the deque.
AddLast Adds a value at the end of the deque.
All Gets an iterator for visiting deque values.
Clear Clears the deque.
First Returns the first value in the deque.
Get
Last Returns the last value in the deque.
PopFirst (Deprecated: use RemoveFirst.)
PopLast (Deprecated: use RemoveLast.)
PushFirst (Deprecated: Use AddFirst)
PushLast (Deprecated: Use AddLast)
RemoveFirst Removes and returns the first value in a deque.
RemoveLast Removes and returns the last value in a deque.
Reserve Reserves deque storage capacity.
Set
ToArray Converts the deque to an array.
Operator []
Operator []=