convert interger to pointer
Jason House
jason.james.house at gmail.com
Sun Jun 29 15:27:18 PDT 2008
Moritz Warning wrote:
> On Sun, 29 Jun 2008 01:56:22 +0000, Moritz Warning wrote:
>
>> Ok, nvm. :)
>>
>> void* p = cast(void*) 1;
>> A a = cast(A) p;
>
> ok, a problem remains.
> How to do this at compile time?:
>
> static const T first = cast(T) cast(void*) 0;
> static const T second = cast(T) cast(void*) 1;
>
> ..doesn't work.
What about doing the reverse... at runtime cast to void* when doing the
comparison. I think casting to void* is free
More information about the Digitalmars-d
mailing list