the.bay.news

[Pitch/Discussion] Introduce `@unsafe(always)` to require explicit unsafe in all language modes

Swift Forums
[Pitch/Discussion] Introduce `@unsafe(always)` to require explicit unsafe in all language modes
Introduction With the recent introduction of opt-in strict memory safety checking (SE-0458), Swift gained the @unsafe attribute. When strict safety mode is enabled, any interaction with unsafe types or functions requires an explicit unsafe effect at the call site: extension Array<Int> { func sum() -> Int { withUnsafeBufferPointer { buffer in unsafe sumIntBuffer(buffer.baseAddress, buffer.count, 0) } } } Motivation Historically, in non-strict modes, Swift has relied on a nam...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.