Eigenpoll : D wish list : array in template arguments
Example:
private import std.stdio;
template test(uint[] arr){
const uint[] test=arr[1..$]~arr[0];
}
int main(){
writefln(test!([1u,2,3,4,5]));
}
current:
private import std.stdio;
template test(char[] arr){
const uint[] test=(uint[])arr[1..$]~(uint)arr[0];
}
int main(){
const char[] t=[(char)1,2,3,4,5]
writefln(test!(t));
}
Report this item for cleanup