MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / emplace

Method emplace

include/reactphysics3d/containers/Array.h:300–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 9

createContactsMethod · 0.80
addPairMethod · 0.80
addNarrowPhaseInfoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected