assert(object) fails to adhere to the principle of least surprise

Bernard Helyer b.helyer at gmail.com
Sat Jan 29 04:09:41 PST 2011


A few corrections.

On Sat, 29 Jan 2011 12:02:57 +0000, Bernard Helyer wrote:
>     auto object = new Object();
>     assert(object);

This segfaults if object is null, which is obviously impossible in this 
example.

> 
> FWIW, GDC doesn't do the rewrite, 

On structs, it does the rewrite on class instances (boo!).


More information about the Digitalmars-d mailing list