InternetAddress comparison fail
Jonathan Marler via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jan 2 17:16:38 PST 2015
Why doesn't the equals operator work on the InternetAddress class?
import std.stdio;
import std.socket;
void main()
{
auto addr1 = new InternetAddress("192.168.0.1", 80);
auto addr2 = new InternetAddress("192.168.0.1", 80);
assert(addr1 == addr2); // FAILS
}
If I am not mistaken, the == operator is overriden by the
opEquals method. I don't see any opEquals method in std.socket
so I'm wondering if this is by design or someone overlooked it?
More information about the Digitalmars-d
mailing list