dcollections

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 6 12:19:44 PST 2012


On Tuesday, November 06, 2012 15:10:26 Joseph Rushton Wakeling wrote:
> Hello all,
> 
> Very naive question about dcollections 2.0 and std.container -- what are the
> reasons why dcollections has had to be developed as a standalone library,
> and what's in the way of incorporating that functionality into Phobos?
> 
> I have some potential use-cases where some of the not-in-Phobos stuff (e.g.
> sets) might be a good solution. It'd clearly be much nicer to be able to
> rely purely on the standard library instead of something outside. So, if
> there are some trivial things that can be done to get code transferred
> (e.g. if it's just a matter of time that people don't have), it'd be nice
> to know, in case I can do something to assist.

There are fundamental differences in how the two work. In particular, 
dcollections supports the ideas of cursors, which I believe are a hybrid of 
sorts between iterators and ranges, while std.container only supports ranges. 
Andrei does not want to add cursors to std.container. Also, IIRC, dcollections 
does more with interfaces, whereas std.container is purely template-based 
(though I'm not 100% sure on that). So, the philosophies behind the two 
libraries are fundamentally different.

If someone wants to take containers from dcollections and port them to 
std.container, they're welcome to do so (that's where RedBlackTree came from), 
but it's not simply a matter of copying what dcollections is doing to Phobos. 
They're too different.

- Jonathan M Davis


More information about the Digitalmars-d mailing list