static foreach direct use of variables

Adam D. Ruppe destructionator at gmail.com
Tue Jan 1 21:17:24 UTC 2019


On Tuesday, 1 January 2019 at 21:14:09 UTC, Michelle Long wrote:
> auto foo(S s)
> {
> 	static foreach(k, p; [s, this])
> 		for(int i = 0; i < p.length; i++)
>         		...
> }

try

static foreach(.......) {{
      stuff
}}


The double {{ and double }} are intentional.



More information about the Digitalmars-d-learn mailing list