docs/definition: !object

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Thu Mar 8 23:58:28 UTC 2018


On 03/08/2018 05:31 AM, Steven Schveighoffer wrote:
> On 3/8/18 1:00 AM, Nick Sabalausky (Abscissa) wrote:
>>
>> 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)

Turns out it wasn't a class at all: As Jacob pointed out in my other 
thread, it *used* to be a class/interface in a previous lib version 
(vibe's TCPConnection) but got changed to a struct without my noticing. 
Hence the seemingly weird behaviours.

> 
> One thing to keep in mind, assert(someObject) does more than just check 
> if it's not null, it also runs the object's invariant to see if it's valid.
> 

Ahh, right! *That's* the part I knew I'd heard about and was trying to 
remember.


More information about the Digitalmars-d-learn mailing list