| 298 | /// Add an element into the array by constructing it directly into the array (in order to avoid a copy) |
| 299 | template<typename...Ts> |
| 300 | void emplace(Ts&&... args) { |
| 301 | |
| 302 | // If we need to allocate more memory |
| 303 | if (mSize == mCapacity) { |
| 304 | reserve(mCapacity == 0 ? GLOBAL_ALIGNMENT : mCapacity * 2); |
| 305 | } |
| 306 | |
| 307 | // Construct the element directly at its location in the array |
| 308 | new (reinterpret_cast<void*>(mBuffer + mSize)) T(std::forward<Ts>(args)...); |
| 309 | |
| 310 | mSize++; |
| 311 | } |
| 312 | |
| 313 | /// Add a given numbers of elements at the end of the array but do not init them |
| 314 | void addWithoutInit(uint64 nbElements) { |
no outgoing calls
no test coverage detected