On 05/15/13 13:04, Dicebot wrote:
> On Wednesday, 15 May 2013 at 10:31:29 UTC, David wrote:
>>> "&c" is address of reference, no class instance. I don't know if there
>>> is a way to get a pointer to class instance in D but I am not aware of one.
>>
>> A simple cast to void* should do it: cast(void*)c

   class C { auto opCast(T:void*)() { return null; } }

So - no - a simple cast to void* won't always work, as the op can be
overloaded, even if only by accident. 

See also:
http://forum.dlang.org/thread/mutvhrrdfzunbrhmv...@forum.dlang.org#post-mailman.2432.1354406246.5162.digitalmars-d-learn:40puremagic.com
and
http://d.puremagic.com/issues/show_bug.cgi?id=8545


artur

Reply via email to