-
-
Save yannick/d992aabc847ea9583ad9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import std.stdio; | |
| //import std.format; | |
| import std.container.rbtree : RedBlackTree; | |
| struct MyStruct | |
| { | |
| long id; | |
| alias id this; | |
| string member; | |
| } | |
| void main() | |
| { | |
| auto rbt = new RedBlackTree!MyStruct(); | |
| auto t = MyStruct( 1, "test"); | |
| rbt.insert(t); | |
| assert( rbt[1] == t ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment