[Issue 12100] __GENTYPE to generate ever different types
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Apr 23 14:31:28 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12100
--- Comment #9 from monarchdodra at gmail.com ---
(In reply to Andrej Mitrovic from comment #7)
> Hmm.. I don't know about that. Really all I wanted was:
>
> auto a = __uniqueID; // "asdf01"
> auto b = __uniqueID; // "asdf02"
>
> It's just something that's incremented internally, but this can only be done
> during that compilation run. I'm not sure whether this would cause any
> problems.
>
> DMD already has something like this that it uses internally, but at runtime
> (of the DMD executable), Lexer::uniqueId.
Yeah, but I'm saying that:
//----
module mod_a;
immutable a = __uniqueID; // "asdf01"
//----
module mod_b;
immutable b = __uniqueID; // "asdf??"
//----
module main;
import mod_a, mod_d;
static assert(a != b);
//----
dmd -c mod_a.d
dmd -c mod_b.d
dmd mod_d.o mod_b.o main.d
Then a "simple" increment scheme won't work, since you'd have reset between two
runs, and have created a duplicate.
But I guess at this point, we agree on the final functionality. The rest is
implementation detail.
--
More information about the Digitalmars-d-bugs
mailing list