LinkedList!int list; scope(exit) list.free(); list.insertBack(0); list.removeFront(); assert(list.length == 0); list.insertBack(1); list.insertBack(2); list.insertBack(3); list.removeFront(); assert(list.length == 2); import std.algorithm : equal; assert(equal(list.byElement(), [2,3]));
Remove the first element. Note: list must be non-empty.