aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/SmallVector.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
index 5496d7acbf..a6b65dd58b 100644
--- a/include/llvm/ADT/SmallVector.h
+++ b/include/llvm/ADT/SmallVector.h
@@ -294,6 +294,16 @@ public:
const SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
+ bool operator==(const SmallVectorImpl &RHS) const {
+ if (size() != RHS.size()) return false;
+ for (T *This = Begin, *That = RHS.Begin, *End = Begin+size();
+ This != End; ++This, ++That)
+ if (*This != *That)
+ return false;
+ return true;
+ }
+ bool operator!=(const SmallVectorImpl &RHS) const { return !(*this == RHS); }
+
private:
/// isSmall - Return true if this is a smallvector which has not had dynamic
/// memory allocated for it.