mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 00:37:09 +00:00
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:
parent
f06f35e30b
commit
1c567b5d92
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user