docs/definition: !object

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Thu Mar 8 06:00:20 UTC 2018


On 03/08/2018 12:05 AM, ketmar wrote:
> Nick Sabalausky (Abscissa) wrote:
> 
>> I'm having trouble finding the documentation for what exactly the 
>> unary "not" operator does when applied to a class/interface object. 
>> Does this documentation exist somewhere?
>>
>> I know at least part of it involves "is null", but I seem to remember 
>> hearing there was more to it than just that.
> 
> https://dlang.org/spec/operatoroverloading.html#boolean_operators
> 
> "Class references are converted to bool by checking to see if the class 
> reference is null or not."

Ah, thanks.

But are we CERTAIN that's all there is to it? I have a non-reduced 
situation right now where outputting the address of a class reveals a 
non-null address, and yet assert(!!theObjectInQuestion) is failing. 
(this is occurring during stack unwinding, if that makes a difference)

(Or does &someObject return the address of the *reference* to the object 
rather than the address of the object?...You can see just how often I do 
OO in D ;) )


More information about the Digitalmars-d-learn mailing list