list

package
v0.0.0-...-41ddf2c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill[T any](value T, count int, capacity ...int) collections.List[T]

Fill creates a new list initialized with a repeated value.

This may have an optional capacity for the list's initial capacity.

func From

func From[T any](e collections.Enumerator[T], capacity ...int) collections.List[T]

From creates a new list from the given enumerator.

This may have an optional capacity for the list's initial capacity. Giving it a capacity will help when the enumerator contains a lot of values.

func New

func New[T any](sizes ...int) collections.List[T]

New creates a new list on an underlying array

The sizes specifies the optional initial length and capacity. If only one size if given, that is the initial size of this list as well as the initial capacity. If a second integer argument is provided it will specify a different capacity from the length. The capacity will never be smaller than the list's length.

func With

func With[T any](s ...T) collections.List[T]

With creates a new list with the given values.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL