UnrolledList

Unrolled Linked List.

Nodes are (by default) sized to fit within a 64-byte cache line. The number of items stored per node can be read from the nodeCapacity field.

Disabled Default Constructor

A disabled default is present on this object. To use it, use one of the other constructors or a factory function.

Constructors

this
this(Allocator allocator)

Use the given allocator for allocations.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

Copying this object is disabled.

A postblit is present on this object, but not explicitly documented in the source.

Members

Aliases

insert
alias insert = insertBack

Inserts the given range into the end of the list

opSlice
alias opSlice = range
put
alias put = insertBack

Inserts the given range into the end of the list

Functions

back
inout(T) back()

Time complexity is O(n)

clear
void clear()

Removes all items from the list

empty
bool empty()
front
inout(T) front()

Time complexity is O(1)

insertAnywhere
void insertAnywhere(T item)

Inserts the given item in the frontmost available cell, which may put the item anywhere in the list as removal may leave gaps in list nodes. Use this only if the order of elements is not important.

insertBack
void insertBack(T item)

Inserts the given item into the end of the list.

insertBack
void insertBack(auto ref R range)

Inserts the given range into the end of the list

length
size_t length()
moveBack
T moveBack()

Removes an item from the back of the list and returns it.

moveFront
T moveFront()

Pops the front item off of the list and returns it

popBack
void popBack()

Pops the back item off of the list.

popFront
void popFront()

Pops the front item off of the list

range
auto range()
remove
bool remove(T item)

Removes the given item from the list.

Variables

nodeCapacity
enum size_t nodeCapacity;

Number of items stored per node.

See Also

Meta