any news on const/invariant?

Derek Parnell derek at nomail.afraid.org
Mon Nov 26 17:01:05 PST 2007


On Mon, 26 Nov 2007 16:36:17 -0800, Walter Bright wrote:

> Derek Parnell wrote:
>> How would I specify that I have a buffer of bytes and I can't change its
>> location but I can change its contents?
> 
> You can't. A good question would be what would be the purpose of such?

I am under the impression that this is a fairly common way of doing things.

   byte[] bitmap;

   bitmap = LoadBitMapFromFile("worldroadmap.bmp");
   GammaAdjust(bitmap, 0.20);

----

   dchar[] Text;

   Text = ReadTextFile("collectedshakespeare.txt");
   ConvertToLowercase(Text);

----   

In other words, there maybe valid reasons to modify data in-place rather
than create a modified copy of the data.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
27/11/2007 11:53:31 AM



More information about the Digitalmars-d mailing list