Welcome to dcollections
(note that some links still point back at dsource, which I will fix when I move that data/pages over to github).
dcollections is an implementation of collection classes inspired by Tango, Java, and C++. The goal of dcollections is to provide an efficient collections implementation that uses as many D ideas as possible.
Dcollections 1.0 has been released and will no longer be maintained (anyone interested in continuing development, please send me a message, and I will link to your fork). It is located in the D1 branch.
Dcollections 2.0 has gone into beta. Version 2.0 is built for D2, and will not work with D1. The version numbers will be 2.0a, 2.0b, etc. until it comes out of beta, and then it will be just called 2.0. The current beta release 2.0c is available in tarball and zip formats.
License
dcollections 1.0 is Open Source software distributed under the BSD License. See the full license here.
dcollections 2.0 is Open Source software distributed under the Boost License. See the full license here.
Features
- Hash, RBTree, Link, Array, and Deque implementations for appropriate containers.
- List, Set, Map, and Multiset containers provided.
- Able to swap out underlying implementation of a container, or customize implementation.
- Minimized heap activity. All cursors and ranges are struct-based.
- Safe slicing.
- Removal while traversing.
- Removal of elements does not invalidate cursors or ranges when possible.
- Cursors and ranges can be kept for later use (such as O(1) removal if supported by the container).
- Interfaces for implementation-independent code.
- Concatenation and appending for lists.
- dup functions.
- Set/Map intersection.
- Filter, transform, and chain iterators.
- Custom allocators.
See the full change log
Documentation
At this point, documentation does not exist online. You must run ddoc on the source to get a documentation output. I am planning on adding dcollections to dub, and use vibe.d's doc generation system (which should become official ddoc eventually).
There is no tutorial, and may never be :( Unfortunately I have very little time. It is on the list of things to do.
TODO
In no specific order:
- Add debug-mode code to allow ranges and cursors to check validity for testing.
- Remove workarounds when compiler is fixed.
- Figure out how to make const cursors/ranges work (need tail-const for this).
- Look into how to have shared containers.
- tutorial