Queue

Simple queue implemented as a singly linked list with a tail pointer.

Needed in some D:YAML code that needs a queue-like structure without too much reallocation that goes with an array.

Allocations are non-GC and are damped by a free-list based on the nodes that are removed. Note that elements lifetime must be managed outside.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

empty
bool empty()
insert
void insert(T item, size_t idx)

Insert a new item putting it to specified index in the linked list.

length
size_t length()
opAssign
void opAssign(Queue )
Undocumented in source.
opCmp
int opCmp(Queue )
Undocumented in source.
opEquals
bool opEquals(Queue )
Undocumented in source.
peek
inout(T) peek()
pop
T pop()
push
void push(T item)

Push a new item to the queue.

range
auto range()

Returns a forward range iterating over this queue.

Meta