]> Sergey Matveev's repositories - btrtrc.git/blob - typed-roaring/iterator.go
Drop support for go 1.20
[btrtrc.git] / typed-roaring / iterator.go
1 package typedRoaring
2
3 import (
4         "github.com/RoaringBitmap/roaring"
5 )
6
7 type Iterator[T BitConstraint] struct {
8         roaring.IntIterator
9 }
10
11 func (t *Iterator[T]) Next() T {
12         return T(t.IntIterator.Next())
13 }
14
15 func (t *Iterator[T]) AdvanceIfNeeded(minVal T) {
16         t.IntIterator.AdvanceIfNeeded(uint32(minVal))
17 }
18
19 func (t *Iterator[T]) Initialize(a *Bitmap[T]) {
20         t.IntIterator.Initialize(&a.Bitmap)
21 }