[swift-evolution] [Review] SE-0136: Memory Layout of Values

Anton Zhilin antonyzhilin at gmail.com
Mon Aug 8 06:35:39 CDT 2016


Honestly, I prefer old 'size(of:)' and 'size(ofValue:)' to new
'MemoryLayout'.
I actually voted against that proposal. Without it, we wouldn't have
problems we have now.
But it's obvious now that it's just a formality to complete the transition.
Sadly.

> I see the obvious difference between the two in their names and
signature, but what is the *need* for both?
> It looks duplicated for the most part, so some clarification would be
nice.

Brandon, if 'T' is a supertype, then 'size(ofValue:T)' returns size of
specific type of its parameter:
let anything: Any = UInt16(0)
size(ofValue: anything)  //=> 2
Believe it or not, some people need that functionality :P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160808/92d6218d/attachment.html>


More information about the swift-evolution mailing list