SList.opEquals

Comparison for equality.

struct SList(T)
inout
bool
opEquals
()
(
auto ref typeof(this) that
)

Parameters

that typeof(this)

The list to compare with.

Return Value

Type: bool

$(D_KEYWORD true) if the lists are equal, $(D_KEYWORD false) otherwise.

Examples

SList!int l1, l2;

l1.insertFront(8);
l1.insertFront(9);
l2.insertFront(8);
l2.insertFront(10);
assert(l1 != l2);

l1.removeFront();
assert(l1 != l2);

l2.removeFront();
assert(l1 == l2);

l1.removeFront();
assert(l1 != l2);

l2.removeFront();
assert(l1 == l2);

Meta