BitSet::with_capacity
pub static fn with_capacity(int bits) -> BitSet Import
Source: use collections::bitset::{BitSet}; src/collections/bitset.hy Empty set with storage for at least bits indices (0 → no words).
Parameters#
| Name | Type |
|---|---|
bits | int |
Returns#
BitSet
Contracts#
Checked according to --contracts (see Contracts).
ensures result.size() == 0
ensures result.capacity() >= bits
See also#
BitSet: A set of non-negativeints stored as bits.BitSet::new: Empty set with no word storage (grows on insert).BitSet::size: Number of set bits (cardinality).BitSet::is_empty: Returnstruewhen no bit is set.BitSet::capacity: Current bit capacity (words.len() * 63); grows when inserting past it.BitSet::insert: Insert indexi; returnstruewhen newly set.BitSet::contains: True when indexiis set.BitSet::remove: Clear indexi; returnstruewhen a bit was unset.