Inability to dup/~ for const arrays of class objects

Steven Schveighoffer schveiguy at yahoo.com
Thu May 30 10:38:51 PDT 2013


On Thu, 30 May 2013 13:33:31 -0400, Ali Çehreli <acehreli at yahoo.com> wrote:

> They are not dynamic in the sense that they are on the heap. (Both your  
> and my examples have trivially shown that.)

Dynamic arrays themselves do not have to be allocated on the heap.

A C++ std::vector is a valid dynamic array type, yet it's actual container  
can exist on the stack.  The data is on the heap, but where the data is  
located is irrelevant.  The important thing here is that any reference to  
the same instance always affects that instance.  It doesn't mysteriously  
split off into another instance.

-Steve


More information about the Digitalmars-d mailing list