"headconst" dynamic arrays?

Jonathan M Davis jmdavisProg at gmx.com
Wed Aug 31 02:50:22 PDT 2011


On Wednesday, August 31, 2011 05:42:07 bearophile wrote: 
> Dynamic arrays that don't change their length and don't allow rebinding, but
> allow changes in their contents, are useful. I use arrays every day in D
> and this desire arises now and then. It's hard to deny this.

Um. Just don't change their length? Sure, it would be nice to be able to have 
this feature, but it's hardly the only issue in D where you can't have a 
particular combination of const and mutable due to how D's const works, and 
really, all you have to do is not alter the length of the array in the 
function that it's passed to. So, yes, it would be nice, but I don't think 
that it's a big deal. Of far greater importance is being able to make the 
elements const, and we can do that quite easily already.

- Jonathan M Davis


More information about the Digitalmars-d mailing list