Add an operator< for SmallVector.
authorDan Gohman <gohman@apple.com>
Fri, 30 May 2008 22:37:47 +0000 (22:37 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 30 May 2008 22:37:47 +0000 (22:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51791 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallVector.h

index 843d561b6bc73b5b30ca3a4440853a2aa30106f8..715f28c279654c75228b5aaefa0f5abcd3fc68c4 100644 (file)
@@ -307,6 +307,11 @@ public:
     return true;
   }
   bool operator!=(const SmallVectorImpl &RHS) const { return !(*this == RHS); }
+
+  bool operator<(const SmallVectorImpl &RHS) const {
+    return std::lexicographical_compare(begin(), end(),
+                                        RHS.begin(), RHS.end());
+  }
   
 private:
   /// isSmall - Return true if this is a smallvector which has not had dynamic