Documentation ¶
Index ¶
- type Vector
- func (v *Vector[T]) At(idx int) T
- func (v *Vector[T]) AtPtr(idx int) *T
- func (v *Vector[T]) Cap() int
- func (v *Vector[T]) Free()
- func (v *Vector[T]) Last() T
- func (v *Vector[T]) Len() int
- func (v *Vector[T]) Pop() T
- func (v *Vector[T]) Push(value T)
- func (v *Vector[T]) Set(idx int, value T)
- func (v *Vector[T]) Slice() []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector ¶
type Vector[T any] struct { // contains filtered or unexported fields }
Vector a contiguous growable array type
func Init ¶
Init initializes a new vector with the T elements provided and sets it's len and cap to len(values)
func New ¶
New creates a new empty vector, if args not provided it will create an empty vector, if only one arg is provided it will init a vector with len and cap equal to the provided arg, if two args are provided it will init a vector with len = args[0] cap = args[1]
func (*Vector[T]) Push ¶
func (v *Vector[T]) Push(value T)
Push pushes value T to the vector, grows if needed.
Click to show internal directories.
Click to hide internal directories.