summaryrefslogtreecommitdiffstats
path: root/mojo/edk/system/ports/name.h
diff options
context:
space:
mode:
Diffstat (limited to 'mojo/edk/system/ports/name.h')
-rw-r--r--mojo/edk/system/ports/name.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/mojo/edk/system/ports/name.h b/mojo/edk/system/ports/name.h
index b0ad0b7..8a9307d 100644
--- a/mojo/edk/system/ports/name.h
+++ b/mojo/edk/system/ports/name.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <ostream>
+#include <tuple>
namespace mojo {
namespace edk {
@@ -21,9 +22,15 @@ struct Name {
inline bool operator==(const Name& a, const Name& b) {
return a.v1 == b.v1 && a.v2 == b.v2;
}
+
inline bool operator!=(const Name& a, const Name& b) {
return !(a == b);
}
+
+inline bool operator<(const Name& a, const Name& b) {
+ return std::tie(a.v1, a.v2) < std::tie(b.v1, b.v2);
+}
+
std::ostream& operator<<(std::ostream& stream, const Name& name);
struct PortName : Name {