Skip to content

Commit 7888250

Browse files
authored
Merge pull request #33 from RougeWare/develop
Merge Develop into Master
2 parents b3a291d + 7e16b9b commit 7888250

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Sources/RectangleTools/Synthesized Conveniences/TwoDimensional Extensions.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,16 @@ public extension TwoDimensional where Length: BinaryInteger {
143143
self.init(measurementX: otherX, measurementY: otherY)
144144
}
145145
}
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+
@inlinable
157+
static var one: Self { self.init(measurementX: 1, measurementY: 1) }
158+
}

0 commit comments

Comments
 (0)