Gollect is a simple collections/data structure library with functionality similar to the STL collections from C++. It utilizes Go's new generics functionality.
This package currently implements the following collections.
A resizable array type, functionally a wrapper around a Go slice.
my_vector := NewVectorFromData[int64](1, 2, 3, 4, 5)
A Vector
with the ability to sort it's elements. Requires elements satisfy the constraints.Ordered
interface (from golang.org/x/exp/constraints)
A Deque
is a double-ended queue.
A Queue
is a single-ended queue.
A Stack
is a FIFO stack.
Elements of the collections included in this package can implement the Destructible
interface which allows the collections to call Destruct()
on the elements when they are removed from the collections.