dcollections 1.0 and 2.0a beta released

Pelle pelle.mansson at gmail.com
Sat May 22 03:51:01 PDT 2010


On 05/22/2010 12:20 PM, bearophile wrote:
> BCS:
>> Maybe the style rule should be: dynamic arrays and AA's should be passed
>> as const or ref.
>
> Something like that must be enforced by the compiler, or the design of arrays/AAs must be changed.
>
> Bye,
> bearophile

It's not a very good rule anyway:

void inc_all(int[] xs) {
     foreach (ref x; xs) {
         x += 1;
     }
}

Wouldn't gain anything from ref, and wouldn't work with const.


More information about the Digitalmars-d-announce mailing list