DIP 1010--Static foreach--Formal Review

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 11:07:49 PDT 2017


On Monday, 10 July 2017 at 08:53:42 UTC, Mike Parker wrote:
> As promised, since there has been zero feedback on DIP 1010, 
> "Static foreach", in either the Draft or Preliminary review 
> rounds, I'm going to skip the normal two-week feedback cycle on 
> the Formal review. If there are no major criticisms or 
> objections raised in this thread, then sometime on Thursday of 
> this week I'll send Walter & Andrei an email kicking off the 
> decision process.
>
> So, if you have any thoughts on the DIP, now is the time to 
> express them.
>
> Thanks!
>
> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1010.md

I have two somewhat related questions.

In the "Generating fields" section, does it have to be a static 
struct? I see another example with an abstract class with a 
static for each, but I don't see simpler struct/class examples.

I ask this because it seems like static foreach can be used to 
provide the same functionality as inout, e.g.

class Foo
{
	static foreach(T; AliasSeq!(int,const(int),immutable(int)))
	{
		void bar(T t)
		{
		}
	}
}




More information about the Digitalmars-d mailing list