compile-time variables?

Bill Baxter dnewsgroup at billbaxter.com
Tue May 22 18:29:05 PDT 2007


Fraser wrote:
> I'm trying to create a compile-rime ID that can be used in mixins. The code it's used in is auto-generated, so I can't guarantee anything, and need a separate ID each time the mixin is used (the ID is part of the mixed-in string).
> 
> Bill Baxter Wrote:
> 
>> Fraser wrote:
>>> <snip>

I see.  Well rule number 1 of CTFE is "no side effects".  So I think 
that pretty much prevents this from working at compile time, since 
storing a state somewhere is definitely a persistent side effect.

Are these IDs all in one file?  If not, then in any event you're going 
to run into trouble making the IDs unique across files with a 
compile-time technique.

--bb



More information about the Digitalmars-d mailing list