[Issue 12100] __GENTYPE to generate ever different types

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 23 14:20:47 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12100

--- Comment #7 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
(In reply to monarchdodra from comment #4)
> (In reply to bearophile_hugs from comment #3)
> > (In reply to Andrej Mitrovic from comment #1)
> > > How about __uniqueID, which would create a unique string ID?
> > 
> > Yes, a progressive integer is enough.
> 
> Well, it still has to be unique cross-compilation run: If you compile
> several different objects differently, then the integer won't be unique.

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.

--


More information about the Digitalmars-d-bugs mailing list