[Issue 12100] __GENTYPE to generate ever different types

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Apr 21 09:44:17 PDT 2014


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

--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
(In reply to Andrej Mitrovic from comment #1)
> How about __uniqueID, which would create a unique string ID? I'd imagine
> this would be more useful since it's more generic, and you could easily
> create a wrapper for it via:
> 
> -----
> template GENTYPE()
> {
>     mixin("struct %1$s { }; alias GENTYPE = %1$s".format(__uniqueID));
> }
> -----

Also __uniqueID would be useful for generating parameter names, and pretty much
anywhere where you're using string mixins and need to use some unique names.

--


More information about the Digitalmars-d-bugs mailing list