4 "github.com/RoaringBitmap/roaring"
7 type Bitmap[T BitConstraint] struct {
11 func (me *Bitmap[T]) Contains(x T) bool {
12 return me.Bitmap.Contains(uint32(x))
15 func (me Bitmap[T]) Iterate(f func(x T) bool) {
16 me.Bitmap.Iterate(func(x uint32) bool {
21 func (me *Bitmap[T]) Add(x T) {
22 me.Bitmap.Add(uint32(x))
25 func (me *Bitmap[T]) Rank(x T) uint64 {
26 return me.Bitmap.Rank(uint32(x))
29 func (me *Bitmap[T]) CheckedRemove(x T) bool {
30 return me.Bitmap.CheckedRemove(uint32(x))
33 func (me *Bitmap[T]) Clone() Bitmap[T] {
34 return Bitmap[T]{*me.Bitmap.Clone()}
37 func (me *Bitmap[T]) CheckedAdd(x T) bool {
38 return me.Bitmap.CheckedAdd(uint32(x))
41 func (me *Bitmap[T]) Remove(x T) {
42 me.Bitmap.Remove(uint32(x))
45 func (me *Bitmap[T]) Iterator() Iterator[T] {
46 return Iterator[T]{me.Bitmap.Iterator()}