package genstack

Import Path
	github.com/jackc/puddle/v2/internal/genstack (on go.dev)

Dependency Relation
	imports 0 packages, and imported by one package

Involved Source Files gen_stack.go stack.go
Package-Level Type Names (total 2, in which 1 is exported)
/* sort exporteds by: | */
Type Parameters: T: any GenStack implements a generational stack. GenStack works as common stack except for the fact that all elements in the older generation are guaranteed to be popped before any element in the newer generation. New elements are always pushed to the current (newest) generation. We could also say that GenStack behaves as a stack in case of a single generation, but it behaves as a queue of individual generation stacks. Len returns number of elements in the stack. NextGen starts a new stack generation. (*GenStack[T]) Pop() (T, bool) Push pushes a new element at the top of the stack. func NewGenStack[T]() *GenStack[T]
Package-Level Functions (only one, which is exported)
Type Parameters: T: any NewGenStack creates a new empty GenStack.