Function Address6.opCmp

Compares two Address6 objects.

int opCmp (
  ref const(Address6) that
) pure nothrow @nogc @safe const;

int opCmp (
  const(Address6) that
) pure nothrow @nogc @safe const;

If this and that contain the same address, scope IDs are compared.

Parameters

NameDescription
that Another address.

Returns

Positive number if this is larger than that, negative - if it is smaller, or 0 if they equal.

Example

assert(address6("::14") > address6("::1"));
assert(address6("::1") < address6("::14"));
assert(address6("::1") == address6("::1"));
assert(address6("fe80::1%1") < address6("fe80::1%2"));
assert(address6("fe80::1%2") > address6("fe80::1%1"));