Listen

Description

Was bisher geschah

Kilians Nutzen von dynamic member lookup für Wrapper-Typen:

struct A {
var foo: Int
}

@dynamicMemberLookup
struct B {
private let a: A
init() {
self.a = A(foo: 1)
}
subscript<T>(dynamicMember keyPath: KeyPath<A, T>) -> T {
a[keyPath: keyPath]
}
}

B().foo

Aktuelles

Picks

Weitere Links