diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-30 22:37:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-30 22:37:47 +0000 |
commit | 11bf2ace556da018c65163557fb97704b1cf88e4 (patch) | |
tree | a1332a3c5af5fc35fb156a0aa5f8c9d25031aae2 /include/llvm/ADT/SmallVector.h | |
parent | dbb8137c112130fabdebfa0fa6c8949707ff17f2 (diff) | |
download | llvm-11bf2ace556da018c65163557fb97704b1cf88e4.tar.gz llvm-11bf2ace556da018c65163557fb97704b1cf88e4.tar.bz2 llvm-11bf2ace556da018c65163557fb97704b1cf88e4.tar.xz |
Add an operator< for SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/SmallVector.h')
-rw-r--r-- | include/llvm/ADT/SmallVector.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 843d561b6b..715f28c279 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -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 |