<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-08-04 21:31 GMT+03:00 Dave Abrahams <span dir="ltr"><<a href="mailto:dabrahams@apple.com" target="_blank">dabrahams@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
on Thu Aug 04 2016, Anton Zhilin <antonyzhilin-AT-gmail.com> wrote:<br>
> Two weeks ago Adrian and I suggested adding dynamic 'size', 'stride',<br>
> 'alignment' to Mirror, which definition would look like:<br>
><br>
> public struct ReflectionWrapper { // fixed!<br>
> internal metatype_: Any.Type<br>
><br>
> public init<T>(_: T.Type)<br>
><br>
> public var size: Int { get }<br>
> public var stride: Int { get }<br>
> public var align: Int { get }<br>
><br>
> // ...<br>
> }<br>
><br>
> There are some problems with it right now, but I do believe that reflection<br>
> API is where dynamic `size`, `stride`, `alignment` belong.<br>
<br>
</div></div>I see your point, but that would unfortunately be an unacceptably<br>
expensive way to get that information. Constructing a mirror is a<br>
nontrivial bit of work.</blockquote><div><br></div><div>I don't mean current heavyweight Mirror. Call that type ReflectionWrapper, if you want. It would only contain 'Any.Type' stored property.</div><div>Largest of 'problems' that I meant is that reflection is postponed, and my type would look odd without full reflection capabilities (only with 'size' and friends).</div></div></div></div>