Documentation ¶
Overview ¶
Package iterator implements a generic iterator protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cycle ¶
type Iterator ¶
type Iterator[T any] struct { // contains filtered or unexported fields }
func (*Iterator[T]) Next ¶
Next returns true if there are any elements remaining to iterate, false otherwise.
func (*Iterator[T]) Value ¶
func (it *Iterator[T]) Value() T
Value returns the element at the current iterator index. Next must have been called prior to a call to Value. If the iterator is exhausted, which is saying the the current index is out of bounds for the data slice, it will return the zero value for the type T.
Click to show internal directories.
Click to hide internal directories.