C++ Container equivalents

Bruce Adams tortoise_74 at spam.no.yahoo.co.uk
Wed Aug 15 01:26:16 PDT 2007


Bill Baxter Wrote:

> Bruce Adams wrote:
> > Hi,
> >     I'm sure these questions come up twice a day and yet there isn't a definitive page on the digital mars website or wiki4d that I can find.
> > (I'd add it myself if I knew the answers and I could figure out how to use wiki4d).
> > What are the best D equivalents to the STL containers?
> > bearing in mind the algorithmic complexity of various kinds of
> > operation. I haven't actually seen a statement of what complexity
> > operations on D arrays is.
> 
> Yes the situation is pretty sad.  D - the language with built-in arrays 
> and hashes, and meta-programming facilities that make little girls cry, 
> but forget it if you're looking for a simple Set type.
>
What's worse than having this defect is burying it.
Amazingly its not a bugzilla issue - it is now 
http://d.puremagic.com/issues/show_bug.cgi?id=1420
 
> The closest thing to "official" container classes is what's in Tango. 
>   Nothing is going to be added to Phobos as far as I know.  Walter just 
> doesn't have time for it.  But Walter is also unwilling to loosen the 
> reigns, so basically Phobos is going nowhere any time soon.
>
Walter needs to delegate.
 
> Hopefully discussions at the D conference will help point the way to a 
> solution to the library predicament D's in.
>
At least its only a week away. 
> 
> Anyway, here are some set-like things I have sitting around:
> 
> Arclib has a RedBlackTree class, and I made some changes to that for my 
> own purposes. It implements set and multiset.
> (http://www.billbaxter.com/projects/d/redblacktree.d
> http://www.billbaxter.com/projects/d/sets.d)
> 
> I also have a class wrapper around an associative array that adds things 
> to make it more set-like.
> (http://www.billbaxter.com/projects/d/aa_set.d)
> 
> 
> --bb



More information about the Digitalmars-d-learn mailing list