resizeable arrays: T[new]

Sean Kelly sean at f4.ca
Tue Jun 5 10:16:53 PDT 2007


It just occurred to me this morning that I may have missed something 
regarding the proposed const changes.  Given the following D 1.0 code, 
can someone tell me whether or how it will change in D 2.0?

     void alter( char[] str )
     {
         str[0] = 'x';
     }

     char[] buf = "abc".dup;

     alter( buf );
     alter( buf[1 .. $] );

     printf( "%.*s\n", buf ); // should print "xxc"



Sean



More information about the Digitalmars-d-announce mailing list