Proposal: Dedicated-string-mixin templates/functions

Nick Sabalausky a at a.a
Thu Feb 11 12:42:02 PST 2010


"Joel Anderson" <ask at me.com> wrote in message 
news:hl1cdn$2fkn$1 at digitalmars.com...
>
> I like having nicer mixing.  My proposal was to allow templates to take a 
> string.  That would make the mixin both visible but still make it look 
> neat.
>
> void mixinString(string T)()
> {
> mixin(func(T));
> }
>
> On the call site...
>
> mixinString!("int a;");
>
> The extra ! indicates that the string must be compile time constant 
> because its going into a template.

While that wouldn't be my preferred solution, I could certainly live with 
that and be very happy.





More information about the Digitalmars-d mailing list