dlist for phobos
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Wed Jan 26 16:46:08 PST 2011
On 1/26/11 6:20 PM, Jonathan M Davis wrote:
> On Wednesday, January 26, 2011 15:34:05 %u wrote:
>> Are there plans for including a double linked list in phobos? Maybe
>> one backed by an array like .NET's List<T> or Java's ArrayList.
>>
>> If so, when?
>
> Array is the equivalent of Java's ArrayList. It's Java's LinkedList which is a
> doubly-linked list. You don't normally use arrays to implement linked lists. We
> do have a _singly_-linked list - SList - but not doubly-linked list at the
> moment. I'd be stunned if Andrei doesn't intend to add one at some point though.
> However, std.container was slow in coming, and it's been slow in growing.
>
> - Jonathan M Davis
One big issue with std.container is that the absence of unified function
call syntax forces the implementation to add a lot of aliases. I'm sort
of stalling in hope that language improvements will prompt terser
container implementations.
I'm also undecided on what to do about sealing, and again language
improvements (preventing escapes of references) could lead to improved
designs.
That being said, a doubly-linked list is an obvious candidate as the
next significant container to put in std.container.
Andrei
More information about the Digitalmars-d
mailing list