Disallow null references in safe code?

deadalnix deadalnix at gmail.com
Mon Feb 3 15:34:58 PST 2014


On Monday, 3 February 2014 at 22:23:52 UTC, Meta wrote:
> If null is an invalid value to assign to a pointer, then 
> there's no issue.
>
> int* foo()
> {
>     //Error: cannot implicitly convert typeof(null) to type int*
>     return "/etc/foo".exists ? new int : null;
> }

Only cross abstraction boundaries is sufficient.


More information about the Digitalmars-d mailing list