List

An array-based list implementation

Constructors

this
this(size_t length)

Constructs a list of specified length

this
this(T[] data)

Constructs a list with specified data

this
this(List!T data)

Constructs a list with specified data

Members

Functions

add
void add(T item)

Add item to list

addRange
void addRange(List!T items)

Add range of items to list

addRange
void addRange(T[] items)

Add range of items to list

clear
void clear()

Clears the list

contains
bool contains(T item)

Returns true if the list contains the item

copyTo
void copyTo(T[] arr, size_t start)

copy elements (starting from start) to array.

empty
bool empty()

Returns wether the list is empty (has no items)

indexOf
ptrdiff_t indexOf(T item)

Returns the index of the first occurence of value. Returns -1 if nothing was found

insert
void insert(size_t index, T item)

Inserts item in to list at index

insertRange
void insertRange(size_t index, List!T items)

Inserts item range in to list at index

insertRange
void insertRange(size_t index, T[] items)

Inserts item range in to list at index

lastIndexOf
ptrdiff_t lastIndexOf(T item)

Returns the index of the last occurence of value. Returns -1 if nothing was found

opAssign
void opAssign(T rhs)

Assignment overload for list

opAssign
void opAssign(T[] rhs)

Assignment overload for list

opIndex
T opIndex(size_t index)

Index overload for list

opIndexAssign
T opIndexAssign(T value, size_t index)

Assignment overload for list at index

opOpAssign
T opOpAssign(T value)

Assignment overload for list append

opOpAssign
T opOpAssign(T[] value)

Assignment overload for list append

opOpAssign
T opOpAssign(List!T value)

Assignment overload for list append

remove
void remove(T item)

Remove item from list

removeAt
void removeAt(size_t index)

Removes the element at index from the list

removeRange
void removeRange(size_t index, size_t count)

Removes a range of items from the list

reverse
void reverse()

Reverses the contents of the list

toArray
T[] toArray()

Returns a copy of the internal data of the list as an array

toString
string toString()

Gets string representation of list

Properties

count
size_t count [@property getter]

Returns the count of items in the list

Meta