tango iterators and related questions

MLT none at anon.com
Tue Apr 21 05:46:18 PDT 2009


D is really great. I am trying to implement a medium sized project to get to know it.
For this I need a sorted data structure, with cheap search, and somewhat cheap forward and backward traversing.

I thought I should use tango (though it is a bit confusing that there is so much overlap between tango and phobos...)
I wanted to use SortedMap. However, I can not figure out how to use the Iterators of SortedMap. 

When I place the Iterator somewhere, how do I find the element (key+value) where it's at?
I see how to get the next key and value (using i.next(k,v)), but I can not see how to get the current one, and how to go up and down the keys. I need to find a certain place, and then look at the key & value above and below that location....

I saw that dcollections does provide this ability, with its cursor.

So new I'm wondering if to use tango+dcollections, phobos+dcollections, or just pick and choose.

I would also really like to stay as standard as possible.

What do you usually use?


More information about the Digitalmars-d-learn mailing list