LinkedList.find

Search for element with value v.

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

Return Value

Type: LinkedListElement!(T)*

Found element or null if could not find.

Examples

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

assert(list.find(42) is null);

list.insertBack(13);
list.insertBack(42);

auto first = list.find(13);
assert(first && first.datum == 13);

auto second = list.find(42);
assert(second && second.datum == 42);

assert(list.find(0) is null);

Meta