Help?

Manu turkeyman at gmail.com
Fri Aug 30 10:27:58 PDT 2013


struct MyStruct; // <- forward declared (opaque type, never defined)

MyStruct*[] arrayOfPointers;

arrayOfPointers ~= null; // appending doesn't work
arrayOfPointers = new MyStruct*[n]; // or just allocating the array doesn't
work either

Complains:
1>code.d(84): Error: struct MyStruct is forward referenced when looking for
'toHash'
1>code.d(84): Error: struct MyStruct is forward referenced when looking for
'opCmp'
1>code.d(84): Error: struct MyStruct is forward referenced when looking for
'toString'
1>code.d(84): Error: struct MyStruct unknown size
1>code.d(84): Error: struct MyStruct no size yet for forward reference
1>code.d(84): Error: struct MyStruct unknown size
1>code.d(84): Error: struct MyStruct no size yet for forward reference

What's the go here?
Why would it need any of that information? It's just a pointer...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130831/18c4074b/attachment.html>


More information about the Digitalmars-d mailing list