mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-30 00:24:00 +00:00
add operator==/!= to smallvector.
llvm-svn: 45872
This commit is contained in:
parent
0293fca6d8
commit
89d996afce
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user