mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
[BitSet] Make BitSet generic over its Element
This gets rid of the weird asymmetry between reading the contents of a BitSet (where we used to always get Int values) and mutating it (where we used to be able to give it values fo any fixed-width integer type).
This commit is contained in:
1 parent
55f3b58437
commit
1d1fbc82d4
26 files changed
+621
-389
No files matched your search
@@ -10,9 +10,9 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
extension BitArray {
|
||||
public init(_ set: BitSet) {
|
||||
public init(_ set: BitSet<Index>) {
|
||||
guard let l = set.last else { self.init(); return }
|
||||
self.init(_storage: set._storage, count: l + 1)
|
||||
self.init(_storage: set._core._storage, count: l + 1)
|
||||
}
|
||||
|
||||
public init<I: BinaryInteger>(bitPattern value: I) {
|
||||
|
||||
Reference in new issue
Block a user