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

Method pop

include/reactphysics3d/containers/Stack.h:159–172  ·  view source on GitHub ↗

Pop an element from the stack (remove it from the stack and return it)

Source from the content-addressed store, hash-verified

157
158 /// Pop an element from the stack (remove it from the stack and return it)
159 T pop() {
160
161 assert(mNbElements > 0);
162
163 mNbElements--;
164
165 // Copy the item
166 T item = mArray[mNbElements];
167
168 // Call the destructor
169 mArray[mNbElements].~T();
170
171 return item;
172 }
173
174 /// Return the top element of the stack
175 T& top() {

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