llvm.org GIT mirror llvm / 8874628
add operator==/!= to smallvector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45872 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
1 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
293293
294294 const SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
295295
296 bool operator==(const SmallVectorImpl &RHS) const {
297 if (size() != RHS.size()) return false;
298 for (T *This = Begin, *That = RHS.Begin, *End = Begin+size();
299 This != End; ++This, ++That)
300 if (*This != *That)
301 return false;
302 return true;
303 }
304 bool operator!=(const SmallVectorImpl &RHS) const { return !(*this == RHS); }
305
296306 private:
297307 /// isSmall - Return true if this is a smallvector which has not had dynamic
298308 /// memory allocated for it.