Thread overview |
---|
July 14, 2004 List, Queue and Stack | ||||
---|---|---|---|---|
| ||||
Hi all, where are the List Queue and Stack object in phobos ? Best regards Pac |
July 14, 2004 Re: List, Queue and Stack | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pac | In article <cd44qs$3ve$1@digitaldaemon.com>, Pac says... > >where are the List Queue and Stack object in phobos ? They're not there explicitly, which isn't a problem because D's arrays are flexible enough to get the job done. > int[] array; > int value; > > array ~= value; // append > array = value ~ array; // prepend > array = array[0..array.length-1]; // remove last element > array = array[1..array.length]; // remove first element > > int first = array[array.length-1]; // get last element > int last = array[0]; // get first element Just be on the lookout for empty arrays and you're practically home free. Now, if its classes or templates you crave, then you'll have to write your own or wait for DTL to come out. :( - Pragma |
July 14, 2004 Re: List, Queue and Stack | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pac | Coming very soon. :) "Pac" <Pac_member@pathlink.com> wrote in message news:cd44qs$3ve$1@digitaldaemon.com... > Hi all, > > > where are the List Queue and Stack object in phobos ? > > > Best regards > > Pac |
Copyright © 1999-2021 by the D Language Foundation