www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - sarrays are value types?

reply Ellery Newcomer <ellery-newcomer utulsa.edu> writes:
I might just be having one of those moments, but if static arrays are 
value types, doesn't it make more sense that

arr1 = arr2;

performs a value copy than a reference copy?
Dec 03 2010
parent reply "Simen kjaeraas" <simen.kjaras gmail.com> writes:
Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:

 I might just be having one of those moments, but if static arrays are  
 value types, doesn't it make more sense that

 arr1 = arr2;

 performs a value copy than a reference copy?

That's what it does. Not a deep value copy, of course, but a value copy. -- Simen
Dec 03 2010
parent bearophile <bearophileHUGS lycos.com> writes:
Simen kjaeraas:

 That's what it does. Not a deep value copy, of course, but a value copy.

See also: http://d.puremagic.com/issues/show_bug.cgi?id=3971 Bye, bearophile
Dec 05 2010