slc

package
v0.0.0-...-40a4415 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

This package contains functions to manipulate slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CircularSelection

func CircularSelection[T any](list []T, index int) T

func CircularSelectionWithIndex

func CircularSelectionWithIndex[T any](list []T, index int) (T, int)

func Copy

func Copy[T any](slice []T) []T

func InsertAt

func InsertAt[T any](slice []T, element T, index int) []T

func RemoveElement

func RemoveElement[T comparable](slice []T, element T) []T

Types

type Iterator

type Iterator[T any] interface {
	Actual() T
	ForEach(f func())
	GoToNext()
	GoToPrevious()
	HasNext() bool
	HasPrevious() bool
	Index() int
	Next() T
	Previous() T
	RemoveActualIndex()
}

func NewIterator

func NewIterator[T any](list []T) Iterator[T]

Jump to

Keyboard shortcuts

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