bug in assigning to dynamic array element

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 1 07:44:54 PDT 2014


On 1 November 2014 14:19, ketmar via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Sat, 1 Nov 2014 13:56:49 +0000
> Iain Buclaw via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
>
>> > if such assigns will be forbidden for any arrays... this is even worse.
>> > "what? your shiny language can't do what even the simpliest C compiler
>> > can do? now try to convince me that D is not a toy."
>> That - for sure - is where you're wrong. :-)
> i was talking about C, not that abomination. but if D will compete with
> C++ for the quirks... than C++ is a winner. ;-)
>
> besides, i clearly see 'list.ptr' there. i don't see 'dynArray.ptr' in
> D code. if i was using '.ptr' directly and it changes by the way... ok,
> it was my fault. but i never used '.ptr' in my sample!

You can clearly see the 'list.length' though.  You can't possibly go
off the assumption that if you grow the size of a dynamic array, it's
area in memory won't be relocated.


More information about the Digitalmars-d mailing list