Created
May 19, 2020 22:02
-
-
Save b3ll/60df234ef932022dbed893c070b4c544 to your computer and use it in GitHub Desktop.
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 Foundation | |
protocol UnpackedProtocol { | |
associatedtype ObjectType | |
associatedtype PointType | |
var points: [PointType] { get set } | |
} | |
struct Box {} | |
struct Sphere {} | |
struct Unpacked<Box, CGFloat>: UnpackedProtocol { | |
typealias ObjectType = Box | |
typealias PointType = CGFloat | |
var points: [CGFloat] | |
} | |
struct Unpacked<Sphere, Double>: UnpackedProtocol { | |
typealias ObjectType = Sphere | |
typealias PointType = Double | |
var points: [Double] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment