Structs with pointers?

Sean Eskapp eatingstaples at gmail.com
Sat Jan 22 14:35:38 PST 2011


Why doesn't this code work?

struct Bar
{
	int* x;
}

void foo(Bar a) {}

void main()
{
	const a = Bar();
	foo(a);
}

But replacing int* with some other type works fine? Even if a write a postblit
function for Bar, it still fails to compile.


More information about the Digitalmars-d-learn mailing list