Adding the ?. null verification

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 18 13:01:30 PDT 2014


Fun fact btw: if you are using methods via ufcs you can check for 
null in there:

class Foo {}

void something(Foo foo) {
    if(foo is null) return;
    foo.something_internal();
}

auto foo = new Foo();
foo.something(); // cool

foo = null;
foo.something(); // still cool


More information about the Digitalmars-d mailing list