Nope. I use it with Metal buffers, for example :)<br><br>Moreover, there's nothing inherently unsafe about sizeof, and I think it's important, *especially when you're working with UnsafePointers*, that safe things look safe. If the moment a pointer comes into the picture everything related to it is prefixed with Unsafe, that word loses its meaning entirely.<br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 2, 2016 at 16:54 Brent Royal-Gordon via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> I don't disagree with the points you make. But one can argue that this is a good thing. It calls attention to code that requires extra attention and care. In some ways this is similar to 'UnsafeMutablePointer<T>' vs '*T'. Verbosity was a deliberate choice in that case.<br>
<br>
You know...rather than introducing a new type like MemoryLayout, would it make sense to do this with static properties on UnsafePointer?<br>
<br>
UnsafePointer<Int>.pointeeSize<br>
UnsafePointer<Int>.pointeeAlignment<br>
UnsafePointer<Int>.pointeeSpacing<br>
<br>
If you need this information, 90% of the time you're probably using UnsafePointer or one of its friends, right?<br>
<br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>