Import std.collections.stack
std.collections.stack
Stack<T>: last in, first out. Push puts a value on top, and Pop takes the top one off.
std/collections/stack.fb
Types
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 18
-
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.
StackIterator
struct
Public Struct StackIterator<T> Implements Iterator<T>
The values of a Stack, from the top down, which For ... In goes over.
std/collections/stack.fb, line 110
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
Report an issue with this page or with FutureBlitz on GitHub.