Stack implementation based on Array.
Free memory allocated by Stack.
Pop top element out.
Non-throwing version of pop.
Push element to stack.
Top stack element. Note: Stack must be non-empty.
Pointer to top stack element. Note: Stack must be non-empty.
Check if stack has no elements.
import std.exception: assertThrown; Stack!int s; assertThrown(s.pop()); s.push(100); s.push(3); s.push(76); assert(s.top() == 76); int v; s.pop(v); assert(v == 76); assert(s.pop() == 3); assert(s.pop() == 100); assert(s.empty); s.free();
See Implementation
Stack implementation based on Array.