adding assert messages to rbtree

This commit is contained in:
Robert Schadek 2020-01-27 09:23:07 +00:00
parent 18bf58f157
commit 09bede3b80

View file

@ -183,7 +183,7 @@ struct RBNode(V)
Node rotateR() Node rotateR()
in in
{ {
assert(_left !is null); assert(_left !is null, "left node must not be null");
} }
do do
{ {
@ -226,7 +226,7 @@ struct RBNode(V)
Node rotateL() Node rotateL()
in in
{ {
assert(_right !is null); assert(_right !is null, "right node must not be null");
} }
do do
{ {
@ -255,7 +255,7 @@ struct RBNode(V)
@property bool isLeftNode() const @property bool isLeftNode() const
in in
{ {
assert(_parent !is null); assert(_parent !is null, "parent must not be null");
} }
do do
{ {
@ -789,7 +789,8 @@ if (is(typeof(binaryFun!less(T.init, T.init))))
private void _setup() private void _setup()
{ {
assert(!_end); //Make sure that _setup isn't run more than once. //Make sure that _setup isn't run more than once.
assert(!_end, "Setup must only be run once");
_begin = _end = allocate(); _begin = _end = allocate();
} }