Skip to content

Commit 3a4e4d1

Browse files
author
Rob Rix
committed
Merge pull request #18 from robrix/unit
Unit
2 parents 5b38050 + 4fdf88d commit 3a4e4d1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Box/Box.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ public final class Box<T>: BoxType, Printable {
99
self.value = value
1010
}
1111

12+
13+
/// Constructs a `Box` with the given `value`.
14+
public class func unit(value: T) -> Box<T> {
15+
return Box(value)
16+
}
17+
18+
1219
/// The (immutable) value wrapped by the receiver.
1320
public let value: T
1421

0 commit comments

Comments
 (0)