mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[cpp] Add Array(capacity) constructor
This commit is contained in:
parent
b9424e0745
commit
e1577829dd
@ -45,6 +45,10 @@ namespace spine {
|
||||
Array() : _size(0), _capacity(0), _buffer(NULL) {
|
||||
}
|
||||
|
||||
Array(size_t capacity) : _size(0), _capacity(0), _buffer(NULL) {
|
||||
ensureCapacity(capacity);
|
||||
}
|
||||
|
||||
Array(const Array &inArray) : _size(inArray._size), _capacity(inArray._capacity), _buffer(NULL) {
|
||||
if (_capacity > 0) {
|
||||
_buffer = allocate(_capacity);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user