On 12/15/2016 09:51 PM, David Zhang wrote:
However, it leaves me with another question, how much (if any) space would the static array require from the class?
Depends on SomeClass. The array's size is just the value of __traits(classInstanceSize, SomeClass). There's no overhead.
You can print such stuff at compile time with pragma(msg, ...): ---- pragma(msg, __traits(classInstanceSize, SomeClass)); pragma(msg, Foo.scStorage.sizeof); /* same */ ----
