What other data structures are available in the C++ STL?
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 开发者_Python百科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.
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.
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
精彩评论