Re: Append const to array

2016-09-20 Thread Yuxuan Shui via Digitalmars-d-learn
On Tuesday, 20 September 2016 at 22:38:33 UTC, Jonathan M Davis wrote: On Tuesday, September 20, 2016 22:23:08 Yuxuan Shui via Digitalmars-d-learn wrote: struct A { ulong[] x; } struct B { ulong x; } void main() { B[] b; const(B) xx = B(1); b ~= xx; // Works A[] c; const(A) yy = A

Re: Append const to array

2016-09-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, September 20, 2016 22:23:08 Yuxuan Shui via Digitalmars-d-learn wrote: > struct A { > ulong[] x; > } > struct B { > ulong x; > } > void main() { > B[] b; > const(B) xx = B(1); > b ~= xx; // Works > > A[] c; > const(A) yy = A([1]); > c ~= yy; // Does not > } > > What giv