|
@ -34,39 +34,45 @@ namespace gp{ |
|
|
second = gp::move(v.second); |
|
|
second = gp::move(v.second); |
|
|
return *this; |
|
|
return *this; |
|
|
} |
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
bool operator==(const pair& rhs) { |
|
|
|
|
|
return first == rhs.first and second == rhs.second; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
template<typename F, typename S> |
|
|
|
|
|
bool operator==(const pair<F, S>& lhs, const pair<F, S>& rhs) { |
|
|
|
|
|
return lhs.first == rhs.first and lhs.second == rhs.second; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bool operator!=(const pair& rhs) { |
|
|
|
|
|
return first != rhs.first or second != rhs.second; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
template<typename F, typename S> |
|
|
|
|
|
bool operator!=(const pair<F, S>& lhs, const pair<F, S>& rhs) { |
|
|
|
|
|
return lhs.first != rhs.first or lhs.second != rhs.second; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bool operator<=(const pair& rhs) { |
|
|
|
|
|
if(first > rhs.first) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} else if(first == rhs.first) { |
|
|
|
|
|
return second <= rhs.second; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
template<typename F, typename S> |
|
|
|
|
|
bool operator<=(const pair<F, S>& lhs, const pair<F, S>& rhs) { |
|
|
|
|
|
if(lhs.first > rhs.first) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} else if(lhs.first == rhs.first) { |
|
|
|
|
|
return lhs.second <= rhs.second; |
|
|
} |
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bool operator>=(const pair& rhs) { |
|
|
|
|
|
if(first < rhs.first) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} else if(first == rhs.first) { |
|
|
|
|
|
return second >= rhs.second; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
template<typename F, typename S> |
|
|
|
|
|
bool operator>=(const pair<F, S>& lhs, const pair<F, S>& rhs) { |
|
|
|
|
|
if(lhs.first < rhs.first) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} else if(lhs.first == rhs.first) { |
|
|
|
|
|
return lhs.second >= rhs.second; |
|
|
} |
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bool operator<(const pair& rhs) { |
|
|
|
|
|
return !(*this >= rhs); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
template<typename F, typename S> |
|
|
|
|
|
bool operator<(const pair<F, S>& lhs, const pair<F, S>& rhs) { |
|
|
|
|
|
return !(lhs >= rhs); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bool operator>(const pair& rhs) { |
|
|
|
|
|
return !(*this <= rhs); |
|
|
|
|
|
p">} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
template<typename F, typename S> |
|
|
|
|
|
bool operator>(const pair<F, S>& lhs, const pair<F, S>& rhs) { |
|
|
|
|
|
k">return !(lhs <= rhs); |
|
|
|
|
|
} |
|
|
} |
|
|
} |