Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: base/containers/container_test_utils.h

Issue 2807933002: Removing (dest != prev) check from LastUnique algorithm. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/containers/container_test_utils.h
diff --git a/base/containers/container_test_utils.h b/base/containers/container_test_utils.h
index e36b9f731252a92510d481028299c1523a48b8c4..251e2a03d4f664c252f20a250c2f9ff4671ddc3a 100644
--- a/base/containers/container_test_utils.h
+++ b/base/containers/container_test_utils.h
@@ -22,10 +22,30 @@ class MoveOnlyInt {
return *this;
}
+ friend bool operator==(const MoveOnlyInt& lhs, const MoveOnlyInt& rhs) {
+ return lhs.data_ == rhs.data_;
+ }
+
+ friend bool operator!=(const MoveOnlyInt& lhs, const MoveOnlyInt& rhs) {
+ return !operator==(lhs, rhs);
+ }
+
friend bool operator<(const MoveOnlyInt& lhs, const MoveOnlyInt& rhs) {
return lhs.data_ < rhs.data_;
}
+ friend bool operator>(const MoveOnlyInt& lhs, const MoveOnlyInt& rhs) {
+ return rhs < lhs;
+ }
+
+ friend bool operator<=(const MoveOnlyInt& lhs, const MoveOnlyInt& rhs) {
+ return !(rhs < lhs);
+ }
+
+ friend bool operator>=(const MoveOnlyInt& lhs, const MoveOnlyInt& rhs) {
+ return !(lhs < rhs);
+ }
+
int data() const { return data_; }
private:

Powered by Google App Engine
This is Rietveld 408576698