mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +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,11 +10,19 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
extension BitArray {
|
||||
/// Create and return a new bit array consisting of `count` random bits.
|
||||
///
|
||||
/// - Parameter count: The number of random bits to generate.
|
||||
public static func random(count: Int) -> BitArray {
|
||||
var rng = SystemRandomNumberGenerator()
|
||||
return random(count: count, using: &rng)
|
||||
}
|
||||
|
||||
/// Create and return a new bit array consisting of `count` random bits,
|
||||
/// using the given random number generator.
|
||||
///
|
||||
/// - Parameter count: The number of random bits to generate.
|
||||
/// - Parameter rng: The random number generator to use.
|
||||
public static func random<R: RandomNumberGenerator>(
|
||||
count: Int,
|
||||
using rng: inout R
|
||||
|
||||
Reference in new issue
Block a user