[PATCH] D124407: Add missing comparison operators to SmallVector

Frederik Gossen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 10:47:09 PDT 2022


frgossen created this revision.
Herald added a subscriber: dexonsmith.
Herald added a project: All.
frgossen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124407

Files:
  llvm/include/llvm/ADT/SmallVector.h


Index: llvm/include/llvm/ADT/SmallVector.h
===================================================================
--- llvm/include/llvm/ADT/SmallVector.h
+++ llvm/include/llvm/ADT/SmallVector.h
@@ -949,6 +949,9 @@
     return std::lexicographical_compare(this->begin(), this->end(),
                                         RHS.begin(), RHS.end());
   }
+  bool operator>(const SmallVectorImpl &RHS) const { return RHS < *this; }
+  bool operator<=(const SmallVectorImpl &RHS) const { return !(*this > RHS); }
+  bool operator>=(const SmallVectorImpl &RHS) const { return !(*this < RHS); }
 };
 
 template <typename T>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124407.424962.patch
Type: text/x-patch
Size: 616 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220425/c0d68cd2/attachment.bin>


More information about the llvm-commits mailing list