Steven Schveighoffer wrote:
On Sun, 15 Nov 2009 01:17:25 -0500, dsimcha <dsim...@yahoo.com> wrote:
3. I don't know how your cursor concept would interact with ranges.
You've
mentioned that cursors have some capabilities that ranges don't, but
they are also
more awkward to use. For a std.collections, I think being range-based
is a must.
I agree. I want to try and preserve the functions that cursors provide
aside from ranges (namely, referring to a single element). What I'm
planning to do is have ranges replace the traversal functions of cursors
and change cursors to simply reference types. That is, you can maintain
a cursor that points at a given element, but you can't move it to
another element in the container without changing it back into a range.
That sounds very good!
BTW, cursors are just C++ iterators, but the term Iterator is currently
defined in Tango as something that you can pass to foreach, so I needed
a different name :)
Now, if I could just find the time...
...or the collaborators... :o)
Also, have you considered contributing the Hash class to the AA
project on dsource
and nominating it to replace the current AA implementation?
My hash implementation isn't anything special, I basically implemented
the pseudo code from my algo book. The only reason it outperforms AA is
because of the custom allocator.
That's a good practical reason to design in custom allocators from day
one then.
Andrei