<div dir="ltr">struct MyStruct; // <- forward declared (opaque type, never defined)<div><br></div><div>MyStruct*[] arrayOfPointers;</div><div><br></div><div>arrayOfPointers ~= null; // appending doesn't work</div><div>
arrayOfPointers = new MyStruct*[n]; // or just allocating the array doesn't work either<br></div><div><br></div><div>Complains:</div><div>1>code.d(84): Error: struct MyStruct is forward referenced when looking for 'toHash'<br>
</div><div><div>1>code.d(84): Error: struct MyStruct is forward referenced when looking for 'opCmp'</div><div>1>code.d(84): Error: struct MyStruct is forward referenced when looking for 'toString'</div>
<div>1>code.d(84): Error: struct MyStruct unknown size</div><div>1>code.d(84): Error: struct MyStruct no size yet for forward reference</div><div>1>code.d(84): Error: struct MyStruct unknown size</div><div>1>code.d(84): Error: struct MyStruct no size yet for forward reference</div>
</div><div><br></div><div>What's the go here?</div><div>Why would it need any of that information? It's just a pointer...</div></div>