mirror of
https://github.com/apple/swift-collections
synced 2026-11-29 05:14:20 +00:00
[BitArray] Add docs.
This commit is contained in:
1 parent
fcac09d86a
commit
5bc22eaf9b
9 files changed
+348
-12
No files matched your search
@@ -10,10 +10,18 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
extension BitArray {
|
||||
/// Set every bit of this array to `value` (`true` by default).
|
||||
///
|
||||
/// - Parameter value: The Boolean value to which to set the array's elements.
|
||||
public mutating func fill(with value: Bool = true) {
|
||||
fill(in: Range(uncheckedBounds: (0, count)), with: value)
|
||||
}
|
||||
|
||||
/// Set every bit of this array within the specified range to `value`
|
||||
/// (`true` by default).
|
||||
///
|
||||
/// - Parameter range: The range whose elements to overwrite.
|
||||
/// - Parameter value: The Boolean value to which to set the array's elements.
|
||||
public mutating func fill(in range: Range<Int>, with value: Bool = true) {
|
||||
_update { handle in
|
||||
if value {
|
||||
|
||||
Reference in new issue
Block a user