Avatar
omochimetaru 2/22/2023 2:57 AM
Hello Swift community, The review of SE-0390: "@noncopyable structs and enums" begins now and runs through March 7, 2023. This feature is already partially implemented on the main branch of Swift behind the -enable-experimental-move-only flag. There are some pieces that landed very recently and are therefore not yet available in the normal ni...
2:57 AM
moveonly typeの審査が来ました!
2:58 AM
@noncopyable struct FileDescriptor { private var fd: Int32 init(fd: Int32) { self.fd = fd } func write(buffer: Data) { buffer.withUnsafeBytes { write(fd, $0.baseAddress!, $0.count) } } deinit { close(fd) } }
2:58 AM
moveonly じゃなくて @noncopyable というアトリビュートになったらしい。 (edited)