[BitArray] Add docs.

This commit is contained in:
Karoy Lorentey committed 2022-08-25 23:50:35 -07:00
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 {