convert interger to pointer
Moritz Warning
moritzwarning at web.de
Sun Jun 29 17:45:25 PDT 2008
On Sun, 29 Jun 2008 18:27:18 -0400, Jason House wrote:
> 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
I did that already.
Thanks for the suggestion.
More information about the Digitalmars-d
mailing list