Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
Stack is a generic stack.
func (*Stack[T]) Peek ¶
func (s *Stack[T]) Peek() (value T)
Peek returns the top value on the stack without removing it.
func (*Stack[T]) PeekDepth ¶
PeekDepth returns the n-th value from the top. PeekDepth(0) is equivalent to the standard Peek().
func (*Stack[T]) PeekReference ¶
func (s *Stack[T]) PeekReference() *T
PeekReference returns a reference to the top value on the stack without removing it.
Click to show internal directories.
Click to hide internal directories.