Struct LinkedList
GC-free single linked list implementation.
struct LinkedList(T, bool ordered = true)
;
Fields
Name | Type | Description |
---|---|---|
head
|
LinkedListElement!T* | Head of the list. |
length
|
size_t | Number of elements in the list. |
tail
|
LinkedListElement!T* | Tail of the list. |
Properties
Name | Type | Description |
---|---|---|
empty [get]
|
bool | Check if list has no elements. |
Methods
Name | Description |
---|---|
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. |