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; what's wrong with that?

Since &thing works, I'm fine with it instead of opCast.  The
opCast was in the code I borrowed so I wanted to show both
approaches for someone to say "this way is better" (which you
did).


I'm not sure how safe casting an object to void* would be, or back. If you can't avoid it, I would say make overloaded methods that do the intermediate work and make it transparent for you afterwards.

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?



Reply via email to