LinkedList and Deque API in DCollections

Christophe Travert travert at phare.normalesup.org
Thu Jun 21 06:06:25 PDT 2012


d coder , dans le message (digitalmars.D:170392), a écrit :
> --f46d04083de73dc5ab04c2fb032c
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Greetings
> 
> I do not know if this email belongs to this list or not. It is about a
> package available at dsource. Let me know if I should be posting such
> emails elsewhere.
> 
> I need an implementation of Doubly Linked list and Deque. Since the
> std.container library does not support these containers yet, I am trying to
> use these from DCollections library available on DSource here
> http://www.dsource.org/projects/dcollections . I am using the D2 branch of
> this library.
> 
> Now the issue is, I could not find any API for adding elements to the
> beginning of the LinkList. In the documentation (which is there for D1
> version) I see methods like append and prepend, but I do not think these
> are implemented in the D2 version of the library. And I see that for Deque,
> only prepend is implemented, there is no append.
>
> Also it is not clear to me if the "add" method could be used to append
> elements on the back of the LinkList or Deque collection.

Did you try : list.insert(list.begin, value);


More information about the Digitalmars-d mailing list