mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
common array: enhance the features.
Add a push() method that appends a whole array instance.
This commit is contained in:
parent
d53d8d726f
commit
192d29fa8a
1 changed files with 7 additions and 0 deletions
|
@ -52,6 +52,13 @@ struct Array
|
|||
data[count++] = element;
|
||||
}
|
||||
|
||||
void push(Array<T>& rhs)
|
||||
{
|
||||
grow(rhs.count);
|
||||
memcpy(data + count, rhs.data, rhs.count * sizeof(T));
|
||||
count += rhs.count;
|
||||
}
|
||||
|
||||
bool reserve(uint32_t size)
|
||||
{
|
||||
if (size > reserved) {
|
||||
|
|
Loading…
Add table
Reference in a new issue