Skip to content

Instantly share code, notes, and snippets.

@andrevidela
Created January 7, 2019 14:17
Show Gist options
  • Select an option

  • Save andrevidela/dd0ca4da36329d3d78341c6e355ccf12 to your computer and use it in GitHub Desktop.

Select an option

Save andrevidela/dd0ca4da36329d3d78341c6e355ccf12 to your computer and use it in GitHub Desktop.
/// Protocol for 2D coordinate systems
protocol TwoDimensions {
associatedtype ComponentVal
static func make2D(_ fst: ComponentVal, _ snd: ComponentVal) -> Self
var fst: ComponentVal { get } // The first component
var snd: ComponentVal { get } // The second component
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment