Skip to content

Instantly share code, notes, and snippets.

@yannick
Created April 20, 2015 13:46
Show Gist options
  • Select an option

  • Save yannick/d992aabc847ea9583ad9 to your computer and use it in GitHub Desktop.

Select an option

Save yannick/d992aabc847ea9583ad9 to your computer and use it in GitHub Desktop.
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