add operator==/!= to smallvector.

llvm-svn: 45872
This commit is contained in:
Chris Lattner 2008-01-11 18:42:02 +00:00
parent 596875118c
commit c70ed4ba5b
1 changed files with 10 additions and 0 deletions

View File

@ -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.