[llvm-commits] [llvm] r51791 - /llvm/trunk/include/llvm/ADT/SmallVector.h

Dan Gohman gohman at apple.com
Fri May 30 15:37:48 PDT 2008


Author: djg
Date: Fri May 30 17:37:47 2008
New Revision: 51791

URL: http://llvm.org/viewvc/llvm-project?rev=51791&view=rev
Log:
Add an operator< for SmallVector.

Modified:
    llvm/trunk/include/llvm/ADT/SmallVector.h

Modified: llvm/trunk/include/llvm/ADT/SmallVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallVector.h?rev=51791&r1=51790&r2=51791&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallVector.h Fri May 30 17:37:47 2008
@@ -307,6 +307,11 @@
     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





More information about the llvm-commits mailing list