Incrementing a variable in CTFE?

Maxime Chevalier maximechevalierb at gmail.com
Fri Nov 9 09:54:53 PST 2012


I'm using the mixin statement to generate function declarations 
based on data structure descriptions (my attempt at declarative 
programming).

I'd like to be able to increment a variable each time I evaluate 
my code generation function in the mixin statement. This is so I 
can generate a unique id number for each data structure. Is there 
any way to do this? Could I increment a CTFE global somehow, or 
use something like C's static local variables?


More information about the Digitalmars-d-learn mailing list