compile time sequence through dub config or commandline.

Sjoerd Nijboer dlang at sjoerdnijboer.com
Sun Dec 2 14:50:05 UTC 2018


I would like to do something like
`
dmd --buildversion=fooCollection{"a", "b", "c"} -run app.d

...

void bar()
{
     static foreach(i; fooCollection)
     {
         ...
     }
}
`

The idea being that bar can be packed in a library and the 
program that includes this library can decide what parameters 
will be added to foo whitout any runtime overhead and ugly 
looking syntax.

Is something simular possible?
If not, could I achieve thesame result by including a file 
`programsettings.d` with some compile time constants in there 
whitout my library depending on it?


More information about the Digitalmars-d-learn mailing list