tupleof on arrays?

Reiner Pope some at address.com
Tue Oct 16 23:39:38 PDT 2007


Yang Bo wrote:
> I have some string generate from template, and I need to dump them to
> stack and modify it. So I write:
> 
> template S(int n) {
>   const char[] S = "n = " ~ n;
> }
> void f() {
>   char[S!(123).length] s = [S!(0).tupleof];
>   s[0] = 'm';
> }
> 
> The problem is, there is not a 'tupleof' property on array. Should this
> feature be buildin ?

What's wrong with simply

void f() {
    char[S!(123).length] s = S!(0);
    s[0] = 'm';
}



More information about the Digitalmars-d mailing list