Pointers vs. References

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Jun 13 05:14:05 PDT 2007


"Ary Manzana" <ary at esperanto.org.ar> wrote in message 
news:f4ombu$16mp$1 at digitalmars.com...
> Can't writing
>
> x == null, x != null
>
> be rewritten by the compiler to
>
> x is null, x !is null
>
> ?
>
>
> I think the two firsts will always segfault. When would a user want to 
> segfault her program? Or, better asked, when would a user want to do x == 
> null?

I don't think the compiler should rewrite it, but I don't think it should be 
allowed either.  Either make it a warning or an error to ==/!= to null. 





More information about the Digitalmars-d mailing list