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

Method push

include/reactphysics3d/containers/Stack.h:144–156  ·  view source on GitHub ↗

Push an element into the stack

Source from the content-addressed store, hash-verified

142
143 /// Push an element into the stack
144 void push(const T& element) {
145
146 // If we need to allocate more elements
147 if (mNbElements == mCapacity) {
148
149 allocate(mCapacity > 0 ? mCapacity * 2 : 1);
150 }
151
152 // Copy the item into the array
153 new (mArray + mNbElements) T(element);
154
155 mNbElements++;
156 }
157
158 /// Pop an element from the stack (remove it from the stack and return it)
159 T pop() {

Callers 7

testConstructorMethod · 0.80
testPushPopMethod · 0.80
findHorizonMethod · 0.80
createIslandsMethod · 0.80
raycastMethod · 0.80

Calls

no outgoing calls

Tested by 2

testConstructorMethod · 0.64
testPushPopMethod · 0.64