> On Jan 9, 2017, at 11:19 PM, Rien via swift-users <swift-users@swift.org> 
> wrote:
> 
> It means that a call to that function with an optional will unwrap the 
> optional before it is used.
> 
> That is quite neat when dealing with C-API’s because often you will receive a 
> pointer from a C-function which is optional to account for the fact that it 
> can be NULL (= nil).
> By using a forced unwrapped input parameter you are saved the trouble of 
> unwrapping all these pointers when using them as input for other C-APIs.
> 
> In short, it makes it easier to interface with C-API’s.
> 
> Note that there is some under-the-hood magic going on because a C-pointer is 
> an unboxed value, while a ‘normal’ optional is a boxed value.

Optionals are never boxed.

-Joe
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to