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:

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

  • 0 downloads total

Score:
0.3
Short URL:
notnull.dub.pm