v2026.5.3
All Bundles
Bundle Generic collections library: Vector (dynamic array), Map (hash map), Set, MultiMap, Stack, Queue, and Pair. Provides typed iteration, sorting, filtering, and functional operations (Reduce, Any, All). Compile with -lib gen_collect.

CompareForwardIterator

Forward iterator of comparables

Operations

Get #

Gets the value that's currently pointed to

method : public : Get() ~ H

Return

TypeDescription
Hvalue value

Example

list := Collection.CompareList->New()<IntRef>;
list->AddBack(IntRef->New(99));
it := list->ForwardIterator()<IntRef>;
it->Get()->PrintLine(); # 99

More #

Checks to see the pointer can be advanced

method : public : More() ~ Bool

Return

TypeDescription
Booltrue if pointer can be advanced, false otherwise

Example

list := Collection.CompareList->New()<IntRef>;
list->AddBack(IntRef->New(5));
it := list->ForwardIterator()<IntRef>;
it->More()->PrintLine(); # true

Next #

Advances the pointer

method : public : Next() ~ Nil

Example

list := Collection.CompareList->New()<IntRef>;
list->AddBack(IntRef->New(1));
list->AddBack(IntRef->New(2));
it := list->ForwardIterator()<IntRef>;
while(it->More()) {
   it->Get()->PrintLine();
   it->Next();
};

Remove #

Removes the element at the pointer position

method : public : Remove() ~ Nil

Example

list := Collection.CompareList->New()<IntRef>;
list->AddBack(IntRef->New(1));
list->AddBack(IntRef->New(2));
it := list->ForwardIterator()<IntRef>;
it->Remove();
list->Size()->PrintLine(); # 1