Append const to array

Yuxuan Shui via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 20 15:23:08 PDT 2016


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 gives?


More information about the Digitalmars-d-learn mailing list