This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Swift | |
public struct CartesianProduct<Base1, Base2> where Base1: Collection, Base2: Collection { | |
@usableFromInline internal let base1: Base1 | |
@usableFromInline internal let base2: Base2 | |
@inlinable | |
internal init(base1: Base1, base2: Base2) { | |
self.base1 = base1 | |
self.base2 = base2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Swift | |
struct ConditionalWrapper<Base> where Base: Sequence { | |
fileprivate let base: Base | |
} | |
extension Sequence { | |
func conditionalWrapper() -> ConditionalWrapper<Self> { | |
return ConditionalWrapper(base: self) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Box<T> { | |
init(value: T) { | |
self.value = value | |
} | |
var value: T | |
} | |
struct MyArray<T> { | |
private var storage: Box<[T]> = Box(value: []) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Swift | |
extension UIApplication { | |
@discardableResult | |
public static func launch(with delegateClass: UIApplicationDelegate.Type) -> Int32 { | |
let type = UnsafeMutablePointer<Int8>.self | |
let count = Int(CommandLine.argc) | |
let principalClassName = NSStringFromClass(self) | |
let delegateClassName = NSStringFromClass(delegateClass) |