Inability to dup/~ for const arrays of class objects

Ali Çehreli acehreli at yahoo.com
Thu May 30 10:33:31 PDT 2013


On 05/30/2013 09:23 AM, Maxim Fomin wrote:

 > Note, that there is no problem with alising of slice and dynamic
 > array, but there is problem with denying that dynamic array (according
 > to spec) is a slice.

That gets back to your "banana" example. Slice and dynamic array is the 
same thing only because the spec says so. They do not have the same 
semantics of dynamic arrays as I know in programming.

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

Further, they are not arrays in the sense that they own elements.

Therefore, calling this concept "dynamic array" is a historical 
accident. The spec may call it "dynamic array" but the spec cannot 
change what "dynamic array" means.

Ali



More information about the Digitalmars-d mailing list