/// Guarantees space for at least one more element, or MinSize more
/// elements if specified.
void grow(size_t MinSize = 0);
-
+
public:
void push_back(const T &Elt) {
if (this->EndX >= this->CapacityX)
void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize) {
size_t CurCapacity = this->capacity();
size_t CurSize = this->size();
- // Always grow, even from zero.
+ // Always grow, even from zero.
size_t NewCapacity = size_t(NextPowerOf2(CurCapacity+2));
if (NewCapacity < MinSize)
NewCapacity = MinSize;
memcpy(this->end(), &Elt, sizeof(T));
this->setEnd(this->end()+1);
}
-
+
void pop_back() {
this->setEnd(this->end()-1);
}