notnull 0.0.1

A small library to make null checks fun.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

NotNull

alt text

A super simple function to make null checks of pointers a breeze for the D Programming Language

unittest {
	import std.exception : assertThrown, assertNotThrown;
	struct A {
	}

	struct B {
		A* a;
	}

	B* b;
	assertThrown!NullPointerException(nnL(b));
	
	b = new B;
	assertNotThrown(nnL(b));

	assertThrown!NullPointerException(nnL(b).a.nnL());
	assertThrown!NullPointerException(b.nnL().a.nnL());

	b.a = new A;
	assertNotThrown(nnL(b).a.nnL());
}
Authors:
  • burner
Dependencies:
none
Versions:
0.1.0 2017-Aug-08
0.0.1 2017-Jul-29
~master 2017-Aug-08
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 16 downloads total

Score:
0.5
Short URL:
notnull.dub.pm