LinkedList.insertAfter

Insert value v after element.

struct LinkedList(T, bool ordered = true)
insertAfter

Return Value

Type: LinkedListElement!(T)*

Pointer to inserted element. Note: element must be not null.

Examples

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

auto first = list.append(1);
auto last = list.append(2);
list.insertAfter(first, 3);

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

Meta