Re: RedBlackTree and myClass

2016-01-03 Thread Tobi G. via Digitalmars-d-learn
On Sunday, 3 January 2016 at 16:44:35 UTC, tsbockman wrote: If it's a private internal data structure which is only used a few places, then sure - just use the minimum code required to get the job done. But, if it's a part of the public API for a module and the class logically has a natural o

Re: RedBlackTree and myClass

2016-01-03 Thread tsbockman via Digitalmars-d-learn
On Sunday, 3 January 2016 at 16:25:31 UTC, Tobi G. wrote: On Sunday, 3 January 2016 at 14:49:59 UTC, tsbockman wrote: Anyway, it's not too hard if you understand what's going on, and all of the functions I added are good things to have anyway, because lots of generic code expects some or all of

Re: RedBlackTree and myClass

2016-01-03 Thread Tobi G. via Digitalmars-d-learn
On Sunday, 3 January 2016 at 14:49:59 UTC, tsbockman wrote: On Sunday, 3 January 2016 at 10:55:05 UTC, AntonSotov wrote: import std.container.rbtree; class myClass { string str; } int main() { auto tree = new RedBlackTree!myClass; return 0; } Error: mutable method object.Object.

Re: RedBlackTree and myClass

2016-01-03 Thread AntonSotov via Digitalmars-d-learn
tsbockman, Many thanks! Now I work for me

Re: RedBlackTree and myClass

2016-01-03 Thread tsbockman via Digitalmars-d-learn
On Sunday, 3 January 2016 at 10:55:05 UTC, AntonSotov wrote: import std.container.rbtree; class myClass { string str; } int main() { auto tree = new RedBlackTree!myClass; return 0; } Error: mutable method object.Object.opCmp is not callable using a inout object Error: template i

Re: RedBlackTree and myClass

2016-01-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, January 03, 2016 10:55:05 AntonSotov via Digitalmars-d-learn wrote: > import std.container.rbtree; > > class myClass { > string str; > } > > > int main() > { > auto tree = new RedBlackTree!myClass; > return 0; > } > > > Error: mutable method object.Object.opCmp is not call

RedBlackTree and myClass

2016-01-03 Thread AntonSotov via Digitalmars-d-learn
import std.container.rbtree; class myClass { string str; } int main() { auto tree = new RedBlackTree!myClass; return 0; } Error: mutable method object.Object.opCmp is not callable using a inout object Error: template instance std.functional.binaryFun!("a < b", "a", "b").binaryFu