Address.opEquals

Compares two addresses for equality.

  1. bool opEquals(T that)
    struct Address
    const
    bool
    opEquals
    (
    T
    )
    ()
    if ()
  2. bool opEquals(T that)

Parameters

T

The type of the other address. It can be $(D_PSYMBOL Address), $(D_PSYMBOL Address4) or $(D_PSYMBOL Address6).

that T

The address to compare with.

Return Value

Type: bool

$(D_KEYWORD true) if this and that addresses are representations of the same IP address, $(D_KEYWORD false) otherwise.

Examples

assert(Address(Address4.loopback) == Address4.loopback);
assert(Address(Address6.loopback) == Address6.loopback);
assert(Address(Address4.loopback) != Address6.loopback);
assert(Address(Address6.loopback) == Address(Address6.loopback));
assert(Address(Address4.loopback) != Address(Address6.loopback));

Meta