List
Generic doubly-linked list
It
List container object
struct It {
std::list<T> handle
};add
Append a value to the end of the list
U0 add(List<T> list, T value);Parameters
list— Target listvalue— Value to append
addAt
Insert a value at a specific index
U0 addAt(List<T> list, T value, I32 index);Parameters
list— Target listvalue— Value to insertindex— Zero-based position
remove
Remove the first matching value from the list
U8 remove(List<T> list, T value);Parameters
list— Target listvalue— Value to find and remove
Returns — Non-zero if element was found and removed
removeAt
Remove the element at a specific index
U0 removeAt(List<T> list, I32 index);Parameters
list— Target listindex— Zero-based position to remove
get
Get a pointer to the element at a specific index
T* get(List<T> list, I32 index);Parameters
list— Target listindex— Zero-based position
Returns — Pointer to the element
set
Set the value of an element at a specific index
U0 set(List<T> list, I32 index, T value);Parameters
list— Target listindex— Zero-based positionvalue— New value
first
Get a pointer to the first element
T* first(List<T> list);Parameters
list— Target list
Returns — Pointer to first element, or NULL if empty
last
Get a pointer to the last element
T* last(List<T> list);Parameters
list— Target list
Returns — Pointer to last element, or NULL if empty
size
Get the number of elements in the list
U64 size(List<T> list);Parameters
list— Target list
Returns — Element count
clear
Remove all elements from the list
U0 clear(List<T> list);Parameters
list— Target list