-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move BitSet constructors from impl<u32> to impl<B> #6
Comments
This is by design for now, to make BitSet easy to use for the usual case (where you don't care about which B is used). There is no real nice way to provide a default B. When rust-lang/rust#27336 is turned on, this will be much easier. |
A default seems nice indeed. But I think functionality trumps convenience. As it is, |
BitSet::default() isn't really hidden. Only that the documentation doesn't point it out. Or anything else either ;) |
As it is now, changing for example BitSet::new() to be generic over B will break compilation for some users, where B can not inferred. That's the kind of drawback waiting for the above linked feature will remove. |
As a middle ground, I would like to just move |
Moving |
😢 yes i didn't see that one. So there is no way to efficiently initialize a bit set (or a bit vector)... |
BitVec has these reverse dependencies (15): https://crates.io/crates/bit-vec/reverse_dependencies BitSet has these reverse dependencies (9): https://crates.io/crates/bit-set/reverse_dependencies If we do a 0.x version bump, it's arguable a sound "reasonable breakage". I had hoped that the default functionality would have been flipped on by now, but it seems there's been some technical difficulties. |
Waiting for a larger overhaul of |
The way things are,
BitSet<B>
for anyB
exceptu32
is almost unusable. The only constructor is pretty much hidden (default()).I propose to move the constructors around from the specialized implementation to the generic one.
It may impact the performances for some use cases. I'm prepared to look into it.
But first, I would love to hear your thought on this.
The text was updated successfully, but these errors were encountered: