示例#1
0
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();
}
示例#2
0
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();
}