static weirdness

Kagamin spam at here.lot
Thu Jan 25 12:38:25 UTC 2018


On Thursday, 25 January 2018 at 12:06:07 UTC, Jonathan M Davis 
wrote:
> Actually, assert on a pointer to a struct or a reference to a 
> class checks for null _and_ calls the invariant, and that 
> hasn't changed. But you have to actually assert the pointer or 
> reference if you want to do that, and the OP didn't do that. He 
> asserted whether it == null.

I mean the compiler implicitly inserted a check like:
struct S
{
     auto fun()
     {
     	assert(&this!=null);
     	return 42;
     }
}


More information about the Digitalmars-d-learn mailing list