friend bool operator==(gva_cache_key const& lhs, gva_cache_key const& rhs) { // Is lhs in rhs? if (1 == lhs.get_count() && 1 != rhs.get_count()) return boost::icl::contains(rhs.key_, lhs.key_); // Is rhs in lhs? else if (1 != lhs.get_count() && 1 == rhs.get_count()) return boost::icl::contains(lhs.key_, rhs.key_); // Direct hit return lhs.key_ == rhs.key_; }
friend bool operator==(gva_cache_key const& lhs, gva_cache_key const& rhs) { // Direct hit if (lhs.key_ == rhs.key_) { return true; } // Is lhs in rhs? if (1 == lhs.get_count() && 1 != rhs.get_count()) { return rhs.key_.first <= lhs.key_.first && lhs.key_.second <= rhs.key_.second; } // Is rhs in lhs? else if (1 != lhs.get_count() && 1 == rhs.get_count()) { return lhs.key_.first <= rhs.key_.first && rhs.key_.second <= lhs.key_.second; } return false; }