Array as an argument, ambiguous behaviour.

Cooler kulkin at hotbox.ru
Thu Jan 30 07:24:14 PST 2014


On Thursday, 30 January 2014 at 14:40:36 UTC, Dicebot wrote:
> On Thursday, 30 January 2014 at 13:42:53 UTC, Cooler wrote:
>> If I use fun2() I expect that fun2() will change the content 
>> of my array, and all changes I will see. If I don't want any 
>> change to my array, I will use fun1(). What should I want to 
>> use fun3()?
>
> For changes to content of array but not array itself.

I agree. I just want that the case can be expressed in language 
syntax more obvious - something like "fun(int[] const x){}" to 
emphasize that I understand that fun() can change content of 
array, and cannot change the {pointer,size} pair.


More information about the Digitalmars-d-learn mailing list