LinkedList.toArray

Convert to array.

struct LinkedList(T, bool ordered = true)
T[]
toArray
()

Examples

LinkedList!int list;
scope(exit) list.free();

list.insertBack(1);
list.insertBack(2);
list.insertBack(3);

auto arr = list.toArray();
assert(arr == [1,2,3]);
Delete(arr);

Meta