Null references redux
BCS
none at anon.com
Sat Sep 26 19:15:42 PDT 2009
Hello Walter,
> The problem with non-nullable references is what do they default to?
> Some "nan" object? When you use a "nan" object, what should it do?
> Throw an exception?
>
They don't have a default. There semantics would be such that the compiler
rejects as illegal any code that would require it to supply a default.
As to the user stuffing "c_empty" in just to get the compiler to shut up;
firstly, that says the variable should not yet be declared as you don't yet
known what value to give it and secondly either c_empy is a rational value
or the user is subverting the type system and is on there own.
More information about the Digitalmars-d
mailing list