LinkedList.insertFront

Insert value v at the beginning.

struct LinkedList(T, bool ordered = true)
insertFront
(
T v
)

Examples

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

list.insertBeginning(1);
list.insertBack(2);
list.insertBeginning(0);

import std.algorithm : equal;
assert(equal(list.byElement(), [0,1,2]));

Meta