3 ms·
They may not be recursive however
by dons 12y ago
They may not be recursive however
- panic 12y agoYou can work around that using a "Box" type that wraps a value in a reference: class Box<T> { var contents : T init(_ initialContents : T) { contents = initialContents } } enum BinaryTree { case Leaf case Branch(Box<BinaryTree>, Box<BinaryTree>) }