static foreach and new identifier names

Meta jared771 at gmail.com
Fri Jan 5 23:52:43 UTC 2018


On Friday, 5 January 2018 at 23:50:52 UTC, Meta wrote:
> On Friday, 5 January 2018 at 17:41:23 UTC, Adam D. Ruppe wrote:
>> Make a special identifier known the compiler, let's call it 
>> `__unique_name` which is unique for any static foreach 
>> iteration.
>
> You can emulate it by abusing the compiler-generated random 
> names for lambdas:
>
> enum uniqueName(string cookie = {}.stringof) = cookie;

But that won't work for what you want. Never mind me.


More information about the Digitalmars-d mailing list