We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b3a291d + 7e16b9b commit 7888250Copy full SHA for 7888250
Sources/RectangleTools/Synthesized Conveniences/TwoDimensional Extensions.swift
@@ -143,3 +143,16 @@ public extension TwoDimensional where Length: BinaryInteger {
143
self.init(measurementX: otherX, measurementY: otherY)
144
}
145
146
+
147
148
149
+public extension TwoDimensional where Length: ExpressibleByIntegerLiteral {
150
151
+ /// An instance of this where both X and Y are `0`
152
+ @inlinable
153
+ static var zero: Self { self.init(measurementX: 0, measurementY: 0) }
154
155
+ /// An instance of this where both X and Y are `1`
156
157
+ static var one: Self { self.init(measurementX: 1, measurementY: 1) }
158
+}
0 commit comments