Object/Archive: Give Child a operator < for map.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Wed, 16 Nov 2011 01:25:13 +0000 (01:25 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Wed, 16 Nov 2011 01:25:13 +0000 (01:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144757 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/Archive.h

index b12b17e1f5b5e4b30867cc09277261a2a72f41ac..9e1369a5c6229a84dc7a3ff83a16d1fb5001ac9b 100644 (file)
@@ -34,6 +34,10 @@ public:
       return (Parent == other.Parent) && (Data.begin() == other.Data.begin());
     }
 
+    bool operator <(const Child &other) const {
+      return Data.begin() < other.Data.begin();
+    }
+
     Child getNext() const;
     error_code getName(StringRef &Result) const;
     int getLastModified() const;
@@ -64,6 +68,10 @@ public:
       return !(*this == other);
     }
 
+    bool operator <(const child_iterator &other) const {
+      return child < other.child;
+    }
+
     child_iterator& operator++() {  // Preincrement
       child = child.getNext();
       return *this;