state of an object

Namespace rswhite4 at googlemail.com
Mon Jul 2 01:41:03 PDT 2012


My intention was to avoid something like this:

[code]
class Foo { }

Foo f; // f is null

NotNull!(Foo) test = f; // should throw an compiler error, 
because f is null
[/code]

I can avoid

NotNull!(Foo) test = null; with

@disable
this(typeof(null));

but how can i avoid null objects?


More information about the Digitalmars-d-learn mailing list