Thread overview
What about sets?
Nov 28, 2011
Andrea Fontana
Nov 28, 2011
Jonathan M Davis
Nov 28, 2011
Andrea Fontana
Nov 28, 2011
Jonathan M Davis
Nov 29, 2011
Andrea Fontana
Nov 29, 2011
Andrej Mitrovic
November 28, 2011
In c++ there are a lot of data structs (vector, hashmap, ...) defined by
stl. I need something similar to c++ "set" in D. Does it exists?
I don't care about order of items, but I need a fast search and a easy
way to iterate. A tree-like struct...



November 28, 2011
On Monday, November 28, 2011 11:48:28 Andrea Fontana wrote:
> In c++ there are a lot of data structs (vector, hashmap, ...) defined by
> stl. I need something similar to c++ "set" in D. Does it exists?
> I don't care about order of items, but I need a fast search and a easy
> way to iterate. A tree-like struct...

http://d-programming-language.org/phobos/std_container.html#RedBlackTree

- Jonathan M Davis
November 28, 2011
Thank you! I didn't check for "std.container" module :)

Il giorno lun, 28/11/2011 alle 02.55 -0800, Jonathan M Davis ha scritto:

> On Monday, November 28, 2011 11:48:28 Andrea Fontana wrote:
> > In c++ there are a lot of data structs (vector, hashmap, ...) defined by
> > stl. I need something similar to c++ "set" in D. Does it exists?
> > I don't care about order of items, but I need a fast search and a easy
> > way to iterate. A tree-like struct...
> 
> http://d-programming-language.org/phobos/std_container.html#RedBlackTree
> 
> - Jonathan M Davis


November 28, 2011
On Monday, November 28, 2011 12:09:45 Andrea Fontana wrote:
> Thank you! I didn't check for "std.container" module :)

I should warn you that std.container a bit sparse at the moment, but RedBlackTree does give you a set (or a sorted map with the appropriate comparator function).

- Jonathan M Davis
November 29, 2011
I was thinking to implement a redblack tree by myself so it's perfect!

Il giorno lun, 28/11/2011 alle 08.44 -0800, Jonathan M Davis ha scritto:

> On Monday, November 28, 2011 12:09:45 Andrea Fontana wrote:
> > Thank you! I didn't check for "std.container" module :)
> 
> I should warn you that std.container a bit sparse at the moment, but RedBlackTree does give you a set (or a sorted map with the appropriate comparator function).
> 
> - Jonathan M Davis


November 29, 2011
Also take a look at dcollections 2.0: http://www.dsource.org/projects/dcollections (the d2 branch). I think RBT was derived from there by Steven himself. Or maybe I'm thinking of another structure.