You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Is it possible to declare a BitVector of a certain dimension in a struct?
Like [bool; 5] for a 5 bit value. I think I could just declare it as BitVector and that should work, but I also would like to enforce the length of the vector. Is this possible?
Thanks
The text was updated successfully, but these errors were encountered:
Currently there is no array type with static sizing in the crate. The best way to accomplish this is with a Rust value such as u8 and a method which produces a &BitSlice reference over it.
I don't have a good concept for statically sized slices yet.
I'm going to close this as "impossible in the current language"; bitvec operates by storing information in pointers, because the type system does not allow me to encode information in it. The current unstable implementation of const generics looks like I will be able to make types such as BitSlice<O, T, const START, const LEN> that correctly manage direct memory locations, but until that stabilizes, bitvec has no way of representing these types.
Hello,
Is it possible to declare a BitVector of a certain dimension in a struct?
Like
[bool; 5]
for a 5 bit value. I think I could just declare it as BitVector and that should work, but I also would like to enforce the length of the vector. Is this possible?Thanks
The text was updated successfully, but these errors were encountered: