コード例 #1
0
bool Depth::operator==(const Depth &other) const {
    if (getLevelCount() != other.getLevelCount()) {
        return false;
    }
    
    for (unsigned int i = 0; i < getLevelCount() &&
                             i < other.getLevelCount(); i++) {
        if (mvDepths[i] != other.mvDepths[i]) {
            return false;
        }
    }
    
    return true;
}
コード例 #2
0
bool Depth::operator<(const Depth &other) const {
    unsigned int i;
    for (i = 0; i < getLevelCount() && i < other.getLevelCount(); i++) {
        if (mvDepths[i] < other.mvDepths[i]) {
            return true;
        } else if (mvDepths[i] > other.mvDepths[i]) {
            return false;
        }
    }
    
    if (i < getLevelCount()) {
        return true;
    } else if (i < other.getLevelCount()) {
        return false;
    }
    
    return false;
}