how to pass multiple arguments via a mixin

Timothee Cour thelastmammoth at gmail.com
Tue Oct 15 17:36:37 PDT 2013


is there a general solution to pass multiple arguments to a function via a
mixin?

see below for a partial solution using Alias, which fails for the last case
below:

void main(){
  import std.stdio;
  string a="A";
  string b="B";
  writeln(a,b);// OK (prints "AB")
  writeln(&a,&b);//OK (prints both addresses)
  writeln(mixin(`a,b`));//prints "B"
  import std.typetuple;
  writeln(mixin(`Alias!(a,b)`));//OK:prints "AB"
  //writeln(mixin(`Alias!(&a,&b)`));//CT Error: expression & a is not a
valid template value argument
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20131015/3ae1207f/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list