[swift-evolution] Proposal: extend Optional-specific syntax to arbitrary types with CustomOptionalConvertible

Matthew Johnson matthew at anandabits.com
Tue Dec 8 10:16:48 CST 2015

> Was it a part of your idea to allow the `PossibleValueType` to be used in Optional-only syntax constructs like conditional binding? If so, do you see any advantages of such solution over `CustomOptionalConvertible`?

Yes that was the point of it.  

The biggest difference is probably avoiding the need to wrap the value in an Optional.  I'm not sure whether that would be a significant advantage or not but I believe it would avoid some copying and reference counting operations.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151208/6f506476/attachment.html>

More information about the swift-evolution mailing list