bool operator ==(const IPAddress &a, const IPAddress &b) { for (qint32 i = 0; i < 4; ++i) { if (a.part(i) != b.part(i)) { return false; } } return a.port() == b.port(); }
bool operator <(const IPAddress &a, const IPAddress &b) { for (int i = 0; i < 4; ++i) { if (a.part(i) < b.part(i)) { return true; } else if (a.part(i) > b.part(i)) { return false; } } return a.port() < b.port(); }