How to expand an expression along with a parameter tuple?

TommiT tommitissari at hotmail.com
Sun Jun 16 23:34:28 PDT 2013


Although... now that I think about it, this should really be done 
as a language feature, and not through some inefficient CTFE 
trick. So, I should really be able to just write this:

int[5] arr = [ 1, 3, 5, 7, 11 ];

void foo(T...)(T values) { }

void bar(T...)(T values)
{
     foo((arr[values] * 10)...);
}

void main()
{
     bar(1, 3, 4);
}


More information about the Digitalmars-d-learn mailing list