3

I'm already aware of the following:

  • arrays
  • bitsets
  • hash maps and sets
  • regular maps and sets
  • iterators
  • lists
  • pairs
  • tuples
  • queues, deques, and priority queues
  • stacks
  • valarrays
  • vectors

Is there any other type of data structure available in the C++ library. What I'm specifically looking for is graphs, but I'd also like to know what else is there.

Also, I'd like to know if there are any external libraries I can link with my projects to implement a graph.

sj755
  • 3,944
  • 14
  • 59
  • 79
  • 2
    Boost.Graph. If you want a comprehensive list of what is provided by the C++ Standard Library, consult the C++ Standard (you can find a link to the latest draft on the [C++0x tag page](http://stackoverflow.com/tags/c%2b%2b0x/info)). If you want a comprehensive list of what your C++ Standard Library implementation supports, consult your implementation's documentation. – James McNellis Dec 13 '10 at 02:28
  • @Chris Yeah, I guess since a string is just an array of chars I should have counted it, not familiar with using the complex type. – sj755 Dec 13 '10 at 17:22

2 Answers2

3

It's "the C++ standard library" or something to that effect, not "the STL". That term refers to an initial draft of some specific data structures and algorithms. Not all of them made it into the standard library, and the standard library also contains other stuff (for example, all the iostream classes).

That looks like a complete list to me (you appear to be talking specifically about C++0x, since you mention tuples and arrays). I don't know if I would even consider bitsets and iterators to be "data structures", but I guess that's a fair description.

There is definitely not a graph implementation. Unfortunately. :( You can get one from Boost, though.

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
2

The STL is divided into three parts:

  • Containers
  • Iterators
  • Algorithms

You have obviously found the containers part and you have probably used the iterators associated with the containers. But there is even more to the iterators than you have found.

The algorithms sections is linked to the containers via iterators. But also contains the parts handle functors and associated binders.

My favortie site for this is: http://www.sgi.com/tech/stl/table_of_contents.html

In addition to the standard libraries you should have a look at the boost libraries:

see also: Boost Library

Community
  • 1
  • 1
Martin York
  • 257,169
  • 86
  • 333
  • 562