Created
January 11, 2018 10:08
-
-
Save SergeyPetrachkov/08454a16bc5d2f64a9b1772d260f337b to your computer and use it in GitHub Desktop.
Copyable in Swift
This file contains hidden or 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
public protocol Copyable { | |
init(other: Self) | |
} | |
public extension Copyable { | |
public func copy() -> Self { | |
return Self.init(other: self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment