Last active
January 7, 2019 14:38
-
-
Save andrevidela/4e309b24060373e521152033519e3365 to your computer and use it in GitHub Desktop.
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
extension Additive where Self: TwoDimensions, Self.ComponentVal: Additive { | |
static var addId: Self { | |
return Self.make2D(Self.ComponentVal.addId, Self.ComponentVal.addId) | |
} | |
static func + (lhs: Self, rhs: Self) -> Self { | |
return make2D(lhs.fst + rhs.fst, lhs.snd + rhs.snd) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment