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
To use it as a drop-in replacement for HashSet, it would be nice to make FixedBitSet generic over its "index", i.e. FixedBitSet<K = usize> where K: From<usize> + Into<usize> (à la typed-index-collections).
So when you have e.g. a custom wrapper type MyId(u32) which is a HashSet<MyId>, and you know the collection is mainly dense (not too many holes), you could very easily switch to FixedBitSet<MyId> without changing anything else in the code.
The text was updated successfully, but these errors were encountered:
bestouff
changed the title
Make FixedBitSet generic
FixedBitSet<K = usize> where K: From<usize> + Into<usize>
Oct 16, 2021
Not sure if this is a great idea due to the costs of monomorphization during compilation and the exposed generics as a part of it's type, which will need to show up in any associated type or generic type constraint. It's also possible to do this by wrapping FixedBitset in your own type as well.
To use it as a drop-in replacement for
HashSet
, it would be nice to makeFixedBitSet
generic over its "index", i.e.FixedBitSet<K = usize> where K: From<usize> + Into<usize>
(à la typed-index-collections).So when you have e.g. a custom wrapper type
MyId(u32)
which is aHashSet<MyId>
, and you know the collection is mainly dense (not too many holes), you could very easily switch toFixedBitSet<MyId>
without changing anything else in the code.The text was updated successfully, but these errors were encountered: