IndirectReference
public struct IndirectReference<T> : Hashable where T : Hashable
Allows recursively referencing a struct within itself.
struct Node {
// MARK: - Public Properties
let id: Int
var left: Node {
self._left.value
}
var right: Node {
self._right.value
}
// MARK: - Private Properties
private let _left: IndirectReference<Node>
private let _right: IndirectReference<Node>
}
-
Set/get the referenced value.
Declaration
Swift
public var value: T { get set }
-
Declaration
Swift
public static func == (lhs: IndirectReference<T>, rhs: IndirectReference<T>) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)