Re: struct to/from void, object to/from void

2012-04-30 Thread Mike Wey
On 04/30/2012 03:01 AM, Era Scarecrow wrote: On Monday, 30 April 2012 at 00:28:15 UTC, Jason King wrote: myobject.sizeof returns 4 (in 32 bit DMD) for every object I've tested, so I'm inclined to suspect its a bog-standard pointer, just what I'm looking to save and retrieve. Anybody else want to

Re: struct to/from void, object to/from void

2012-04-29 Thread Era Scarecrow
On Monday, 30 April 2012 at 05:07:04 UTC, Ali Çehreli wrote: You mean "object"? A class variable is just a handle to the class object. Class variables are implemented as pointers, so yes, they will be the size of a pointer. Since I suspect that the pointers are 4 bytes on the OP's 32-bit system

Re: struct to/from void, object to/from void

2012-04-29 Thread Ali Çehreli
On 04/29/2012 06:01 PM, Era Scarecrow wrote: > On Monday, 30 April 2012 at 00:28:15 UTC, Jason King wrote: >> myobject.sizeof returns 4 (in 32 bit DMD) for every object I've >> tested, so I'm inclined to suspect its a bog-standard pointer, >> just what I'm looking to save and retrieve. >> Anybody

Re: struct to/from void, object to/from void

2012-04-29 Thread Era Scarecrow
On Monday, 30 April 2012 at 00:28:15 UTC, Jason King wrote: myobject.sizeof returns 4 (in 32 bit DMD) for every object I've tested, so I'm inclined to suspect its a bog-standard pointer, just what I'm looking to save and retrieve. Anybody else want to chime in? I'd say that's right and wrong.

Re: struct to/from void, object to/from void

2012-04-29 Thread Jason King
Thanks for the rapid reply. void* opCast() { return &this; } Honestly, in my opinion, drop this. Don't make it more 'pointer-like'. Unless there's a good reason, or it makes sense (Mathematical), then don't. You keep having half the tests using regular &(address) operator; wha

Re: struct to/from void, object to/from void

2012-04-29 Thread Era Scarecrow
On Sunday, 29 April 2012 at 22:35:19 UTC, Jason King wrote: I'm another of what seem to be legions of people trying to interface with OS stores that keep void * in c/c++. My particular one is Windows TLSData, but for my example I don't need any Windows code, just D. void* opCast() {