Looking for documentation of D's lower-level aspects.

Jonathan M Davis jmdavisProg at gmx.com
Sat Oct 22 13:51:14 PDT 2011


On Saturday, October 22, 2011 17:04:57 Sean Silva wrote:
> I don't doubt anything that you just said. But as you said, Phobos
> *currently* doesn't have what I want, which is an issue if I am
> wanting to develop code now or soon. The path of least resistance in
> the interim is to just implement some familiar STL containers in such
> a way that they work with std.algorithm, and just use them.
> 
> Also, do you know whether any of Andrei's thoughts on the directions
> he wants to take std.container are available online? I'm just curious
> because I've seen mention of an article "Sealed Containers" he was
> going to write, but it seems that it fell through. I'm just interested
> because if I'm going to be writing containers from scratch, I would
> like to take some of his ideas and put them into practice, both to be
> forward-looking to what std.container will eventually have, and to
> maybe help out by field-testing some of the ideas.

The primarily intended API is listed at the top of std.container. The list of 
function names and what the worse complexity thate they're supposed to have is 
are listed there. The main planned changes that I'm aware of are to

1. Make all containers final classes (Array and SList are currently reference-
counted structs).

2. Add support for custom allocators (likely done at runtime rather than as 
template arguments, but the custom allocator situation is still being sorted 
out).

3. Add more containers.

How that relates to sealed containers, I don't know. I don't remember the 
details on them, so I don't remember if what we have is sealed or not, let 
alone whether what we're going to have is sealed or not. If you want 
additional container classes in the interim, I'd suggest checking out 
dcollections ( http://dsource.org/projects/dcollections ). The implementation 
for std.container.RedBlackTree came from there.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list