Avatar
struct Container<Value> { var value: Value init(value: Value) { self.value = value } func withValue(action: (Value) -> ()) { action(value) } } var container = Container<Any>(value: "foo") container.withValue { value in print(value) container.value = "bar" print(value) }
10:05 PM
swiftc -O a.swift && ./aswiftc a.swift && ./a で結果が異なる (edited)