Empties the stack
Reads and removes an array of items from the stack, if not enough items are left, throws Exception
Reads and removes an item from the stack, if no more items are present, throws Exception
Appends an item to the stack
Appends an array of items to the stack
Number of items in stack
Unittests for Stack
Stack!ubyte stack = new Stack!ubyte; //`Stack.push` and `Stack.pop` stack.push(0); stack.push([1, 2]); assert(stack.pop == 2); assert(stack.pop(2) == [1, 0]); stack.push([1, 0]); assert(stack.pop!(true)(2) == [1, 0]); //`Stack.clear` && `Stack.count` stack.push(0); assert(stack.count == 1); stack.clear; assert(stack.count == 0); stack.destroy;
A basic stack with push, and pop