On Wednesday, 24 January 2018 at 07:55:01 UTC, thedeemon wrote:
On Tuesday, 23 January 2018 at 00:00:38 UTC, aliak wrote:
The struct defined inside a scope can mention variables defined
in that scope (e.g. use them in its methods), so it needs a
pointer to the place where those closed variables live. That's
the main difference between such struct and a static one that
cannot use those scope vars. I guess you're seeing that pointer
as additional member.
As for static foreach, when you write a simple foreach over
some compile-time tuple (like in this case), it's unrolled at
compile time similarly to "static foreach", the main difference
is whether it creates a sub-scope for the loop body or not.
"foreach" creates one, "static foreach" doesn't.
Ah makes sense. Thanks!