C++ Container equivalents
Carlos Santander
csantander619 at gmail.com
Tue Aug 14 20:17:28 PDT 2007
Bruce Adams escribió:
> 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.
>
> Most of the time D arrays should be enough. In C++ I end up using
> vector, map and set the most. The set is the main one I want
> to identify an equivalent to.
>
> I've seen references to dtl and minTL. dtl is apparently 'resting'.
> The link to minTL seems to be broken.
> Ideally I want to use something that is a sanctioned part of D/Phobos
> or likely to become so.
>
> Who can point me in the right directions?
>
> Regards,
>
> Bruce.
>
>
> I've pasted the complete list from the SGI site and filled in
> what I can which is almost nothing.
>
>
> Sequences:
>
> vector - D (dynamic) array
> deque - D (dynamic) array?
> list
> slist
> bit_vector
>
> Associative Containers:
>
> set
> map - D associative array (strictly a hash map)
> multiset
> multimap
> hash_set
> hash_map - D associative array
> hash_multiset
> hash_multimap
> hash
> basic_string - D array (char[])
> rope
>
Tango has the tango.util.collection package.
There is also the MinTL library (I don't have the link to it ATM). I think
someone updated it fairly recently, but I'm not completely sure.
I think there are more options out there, but those are the only two I can think
of right now. Check the Wiki for more about that.
--
Carlos Santander Bernal
More information about the Digitalmars-d-learn
mailing list