[TWiD] static foreach loop variable

Nick Treleaven nick at geany.org
Tue May 28 13:43:45 UTC 2019


Hi,
Last week's TWiD had a tip that didn't make sense:
http://dpldocs.info/this-week-in-d/Blog.Posted_2019_05_20.html#tip-of-the-week

template Locals(int i) {
     alias Whatever = int;
}

static foreach(i; [1, 2, 3]) {
    Locals!i.Whatever;
}

The body is just `int;`. Not sure how to reach Adam. What was 
intended?


More information about the Digitalmars-d-learn mailing list