Closed
Description
use std::collections::Bitv;
fn main() {
let mut bitv = Bitv::with_capacity((!0u32) as uint, false);
bitv.grow(1, true);
println!("{}", bitv.get(0));
}
task '<main>' failed at 'assertion failed: i < self.nbits', ...
since the grow
is wrapping the internal (32-bit) uint
. (A naive bit counter for a bit vector needs 3 additional bits over a uint
to be guaranteed to work always.)
Metadata
Metadata
Assignees
Labels
No labels