To Walter, about char[] initialization by FF

Serg Kovrov user at domain.invalid
Mon Jul 31 04:27:42 PDT 2006


* Frits van Bommel:
> Serg Kovrov wrote:
>> * Oskar Linde:
>>> Counting the number of characters is also a rather expensive
>>> operation. 
>>
>> Indeed. Store once as property (and update as needed) is better than 
>> calculate it each time you need it.
> 
> Store where? You can't put it in the array data itself without breaking 
> slicing, and you putting it in the reference introduces problems with it 
> getting out of date if the array is modified through another reference 
> (without enforcing COW, that is).

Need to say that I no not have an idea where to store it, neither where 
current length property stored. I'm really glad that compiler do it for me.

As language user I just want to be confident that compiler do it wisely, 
and focus on my domain problems.



More information about the Digitalmars-d mailing list