Import std.collections.stack
Stack
class
@DebugElements Public Class Stack<T> Implements Iterable<T>, Cloneable, Defaultable
Last in, first out: Push puts a value on top, and Pop takes the top one off.
Examples
Local stack = Stack<Int>()
stack.Push(1)
stack.Push(2)
Expect(stack.Pop() == 2)
Expect(stack.Count == 1)std/collections/stack.fb, line 20
-
How many values it holds.
-
Puts
valueon top. -
The same as Push.
-
Pushes each of the
values, in order, so the last ends up on top. -
Takes the top value off and gives it. Panics when the Stack is empty.
-
The top value, which stays. Panics when the Stack is empty.
-
Takes the top value off and gives it, or Null when the Stack is empty.
-
The top value, which stays, or Null when the Stack is empty.
-
The values from the top down, the order Pop gives them, in a new array.
-
Whether it holds
value. -
Takes every value off.
-
A new, empty Stack.
-
A new Stack with the same values.
-
The values from the top down, the order Pop gives them. Changing the Stack while going over them panics.
Report an issue with this page or with FutureBlitz on GitHub.