mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Make VectorFormatter support stateful formatters
This commit is contained in:
committed by
Pieter Wuille
parent
3ca574cef0
commit
56dd9f04c7
@@ -424,15 +424,20 @@ public:
|
||||
return first;
|
||||
}
|
||||
|
||||
void push_back(const T& value) {
|
||||
template<typename... Args>
|
||||
void emplace_back(Args&&... args) {
|
||||
size_type new_size = size() + 1;
|
||||
if (capacity() < new_size) {
|
||||
change_capacity(new_size + (new_size >> 1));
|
||||
}
|
||||
new(item_ptr(size())) T(value);
|
||||
new(item_ptr(size())) T(std::forward<Args>(args)...);
|
||||
_size++;
|
||||
}
|
||||
|
||||
void push_back(const T& value) {
|
||||
emplace_back(value);
|
||||
}
|
||||
|
||||
void pop_back() {
|
||||
erase(end() - 1, end());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user