This commit is contained in:
Christoffer Lerno
2025-08-21 01:46:41 +02:00
parent a2ef63f5b6
commit 2e1f7c95ce
2 changed files with 7 additions and 1 deletions

View File

@@ -136,6 +136,7 @@ fn void BitSet.unset(&self, usz i)
@param i : "The index of the bit"
@require i < SIZE : "Index was out of range"
@pure
*>
fn bool BitSet.get(&self, usz i) @operator([]) @inline
{
@@ -144,6 +145,11 @@ fn bool BitSet.get(&self, usz i) @operator([]) @inline
return self.data[q] & (1 << r) != 0;
}
<*
Return the number of bits.
@pure
*>
fn usz BitSet.len(&self) @operator(len) @inline
{
return SZ * BITS;