[Glacier] Add the ability to remove a character from a StringBuilder.
This commit is contained in:
parent
134185117d
commit
c8e5441c7f
3 changed files with 33 additions and 0 deletions
|
|
@ -45,6 +45,8 @@ class Vector {
|
|||
template <typename... Args>
|
||||
void EmplaceBack(Args&&... args);
|
||||
|
||||
T&& PopBack();
|
||||
|
||||
private:
|
||||
T* data_;
|
||||
uint64_t size_;
|
||||
|
|
@ -119,6 +121,12 @@ void Vector<T>::EmplaceBack(Args&&... args) {
|
|||
data_[size_++] = T(args...);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T&& Vector<T>::PopBack() {
|
||||
size_--;
|
||||
return glcr::Move(data_[size_]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void Vector<T>::Expand() {
|
||||
uint64_t new_capacity = capacity_ == 0 ? 1 : capacity_ * 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue