C++ Container equivalents

Bruce Adams tortoise_74 at no.yahoo.spam.co.uk
Tue Aug 14 19:44:48 PDT 2007


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



More information about the Digitalmars-d-learn mailing list