Re: rtInfo issue

2012-12-09 Thread Walter Bright
On 12/9/2012 12:28 PM, Benjamin Thaut wrote: But why does adding a void* pointer make a difference then? By adding a void* pointer to the struct it will still not be referenced Before (broken): struct Pod { float x; } After (working): struct Pod { float x; void* ptr; } I suggest looking at

Re: rtInfo issue

2012-12-09 Thread Benjamin Thaut
Ok I tried to manually reference it, it does not help. struct Quaternion { float x,y,z,angle; } class ForceReference { Quaternion q; } shared static this() { Quaternion q; auto t = typeid(Quaternion); auto info = RTInfo!Quaternion; printf("%x %x\n", info, t.rtInfo); } Althoug

Re: rtInfo issue

2012-12-09 Thread Benjamin Thaut
Am 09.12.2012 21:22, schrieb Walter Bright:> > > Template instances are written to COMDAT sections, which are stripped > out if they are not referenced. > But why does adding a void* pointer make a difference then? By adding a void* pointer to the struct it will still not be referenced Before

Re: rtInfo issue

2012-12-09 Thread Walter Bright
On 12/9/2012 11:36 AM, Benjamin Thaut wrote: If a POD struct (which does not contain any reference types, pointers, arrays etc) is placed in a library. And that library is then linked against a executable, the rtInfo of the POD struct will be lost. It will be generated by the compiler when compil

rtInfo issue

2012-12-09 Thread Benjamin Thaut
I'm currently using the rtInfo template inside object.d to generate RTTI information for my own little rtti system. It is working really well so far, the only issue I found is as follows: If a POD struct (which does not contain any reference types, pointers, arrays etc) is placed in a library.