Struct LinkedList

GC-free single linked list implementation.

struct LinkedList(T, bool ordered = true) ;

Fields

NameTypeDescription
head LinkedListElement!T*Head of the list.
length size_tNumber of elements in the list.
tail LinkedListElement!T*Tail of the list.

Properties

NameTypeDescription
empty[get] boolCheck if list has no elements.

Methods

NameDescription
appendList (list) Append other list.
find (v) Search for element with value v.
free () Remove all elements and free used memory.
insertAfter (element, v) Insert value v after element.
insertBack (v) Appen value v to the end.
insertFront (v) Insert value v at the beginning.
opApply (dg) Iterating over list via foreach.
opApply (dg) Iterating over list via foreach.
removeAfter (element) Remove value after element.
removeFront () Remove the first element.
toArray () Convert to array.