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

Unified Diff: mojo/public/cpp/system/handle.h

Issue 1526493002: Add comparison operator to mojo::Handle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/system/handle.h
diff --git a/mojo/public/cpp/system/handle.h b/mojo/public/cpp/system/handle.h
index 45624bc66d80c2170637c7e86d4a21b4dc0a3487..1c3b149797af15eff06de555adf7b555d4210e1a 100644
--- a/mojo/public/cpp/system/handle.h
+++ b/mojo/public/cpp/system/handle.h
@@ -285,6 +285,11 @@ inline bool operator<(const Handle a, const Handle b) {
return a.value() < b.value();
}
+// Comparison, so that |Handle|s can be used as keys in hash maps.
+inline bool operator==(const Handle a, const Handle b) {
+ return a.value() == b.value();
+}
+
} // namespace mojo
#endif // MOJO_PUBLIC_CPP_SYSTEM_HANDLE_H_
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698