Bug in the spec or implementation?
simendsjo
simen.endsjo at pandavre.com
Thu Aug 5 11:45:18 PDT 2010
This is only tested on dmd 2.047 on win7.
According to the spec at http://digitalmars.com/d/2.0/arrays.html:
"Concatenation always creates a copy of its operands, even if one of the
operands is a 0 length array"
But this doesn't seem like the case:
auto a = [0];
auto oldPtr = a.ptr;
assert(a.length == 1);
assert(a.capacity == 3);
a ~= 1;
assert(a.ptr != oldPtr); // Fails - Still the same array
More information about the Digitalmars-d
mailing list