I really like this idea. This IMO is lower level functionality than `type(of:)` 
(née dynamicType), so I think it makes sense for it to be grouped under its own 
domain, the MemoryLayout type.

Plus MemoryLayout can be extended with new convenience methods.

I’m fine with those old methods being removed, but I never use them so! Is it 
the same as calling type(of:) then using that with MemoryLayout? I imagine they 
could be fixit’d easily, and that they compile down to the same underlying code.

Patrick

> On 2 Jun 2016, at 3:05 PM, Xiaodi Wu via swift-evolution 
> <[email protected]> wrote:
> 
> 2. Dave A. and others expressed the opinion that these should probably not be 
> global functions; his preference was for:
> 
> ```
> MemoryLayout<T>.size // currently sizeof()
> MemoryLayout<T>.spacing // currently strideof()
> MemoryLayout<T>.alignment // currently alignof()
> ```
> 
> 3. Dave A. proposed that sizeofValue(), strideofValue(), and alignofValue() 
> are better off removed altogether. I don't know if people are going to be 
> happy about this idea.

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to