I’m continuing my work on various red black tree implementations here. So far I’ve only got one that’s not completed tested nor cleaned up, but it’s 100% safe and not too convoluted . I’m especially proud of the macro I wrote to verify the tree structure, basically I can write:

verify!{ tree => <B.2> B.1 <R.4 B.3 };

It saves me SO much typing in the tests.

Edit: to clarify, the above macro call would expand to this: