Stack overflow
Jonathan M Davis
jmdavisProg at gmx.com
Mon Jun 25 03:10:26 PDT 2012
On Monday, June 25, 2012 10:18:19 Namespace wrote:
> > If you don't need to use any compile-time reflection on the
> > type itself (i.e.
> > you just need its name), you can use a string mixin.
> >
> > - Jonathan M Davis
>
> You mean i should pack the whole mixin template in a string?
> Isn't that a little bit ugly?
More or less yeah. You generate the code as a string and then mix it in. As
it's a string, it's really easy to manipulate, and if you lay out the strings
properly, it's not really even particularly hard to read. Personally, I never
use template mixins, and I get the impression that string mixins get used a
lot more than template mixins do.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list