Spec#, nullables and more

bearophile bearophileHUGS at lycos.com
Fri Nov 5 22:25:59 PDT 2010


Rainer Deyke Wrote:

> That's a faulty idiom.  A data structure that exists but contains no
> valid data is a bug waiting to happen - no, it /is/ a bug, even if it
> does not yet manifest as incorrect observable behavior.  (Or at best,
> it's an unsafe optimization technique that should be wrapped up in an
> encapsulating function.)

Regardless what that is, the presence of nonnull reference types in the language doesn't forbid you to use that idiom used by Walter, because on default in D references and pointers will keep being nullable, so the old code keeps working.

Bye,
bearophile


More information about the Digitalmars-d mailing list