(non)nullable types

Christopher Wright dhasenan at gmail.com
Sat Feb 14 05:32:49 PST 2009


Daniel Keep wrote:
> Both of these syntaxes are solving a problem that doesn't exist.  This
> is why we have null dereference exceptions: accessing a null pointer is
> an error.  All this is doing is moving the onus for the check from the
> hardware to the programmer.

I believe you should be able to use a nullable variable like its 
non-nullable counterpart.

I am uncertain, but perhaps you should be able to implicitly cast to 
non-nullable, with an assertion added that the variable is not null. 
This gives you the safety of using non-nullable types and the ease of 
use of using nullable types.



More information about the Digitalmars-d mailing list