Signals and Slots in D

Frank Benoit keinfarbton at nospam.xyz
Thu Sep 28 23:50:11 PDT 2006


Walter Bright schrieb:
> Walter Bright wrote:
>> Chad J > wrote:
>>> Couldn't you also do weak pointers by XORing them with 0xFFFFFFFF
>>> (or, better yet, const size_t weakxor = -1), then XORing again before
>>> and after you need to operate on them?
>>>
>>> Just thought I'd toss that out there.
>>
>> You're very devious! I like that idea. (All you need to do is set the
>> least significant bit to 1.)
> 
> Spoke too soon. That won't work.

Inverting the lsb will not, because it is also a valid ptr to the object.
Inverting the msb should always work. Well it should work in the way,
that it does not prevent the object from being deleted.
But how can it be tested, that the ptr is callable?



More information about the Digitalmars-d mailing list