add a new assign method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-08-08 01:44:16 +00:00
parent f06f35e30b
commit 1c567b5d92

View File

@ -146,6 +146,15 @@ public:
End += NumInputs;
}
void assign(unsigned NumElts, const T &Elt) {
clear();
if (NumElts > Capacity)
grow(NumElts);
End = Begin+NumElts;
for (; NumElts; --NumElts)
new (Begin+NumElts-1) T(Elt);
}
const SmallVector &operator=(const SmallVector &RHS) {
// Avoid self-assignment.
if (this == &RHS) return *this;