In this chapter, we introduced the Standard Template Library and discussed its three key componentscontainers, iterators and algorithms. You learned the STL sequence containers, `vector`, `deque` and `list`, which represent linear data structures. We discussed associative containers, `set`, `multiset`, `map` and `multimap`, which represent nonlinear data structures. You also saw that the container adapters `stack`, `queue` and `priority_queue` can be used to restrict the operations of the sequence containers for the purpose of implementing the specialized data structures represented by the container adapters. We then demonstrated many of the STL algorithms, including mathematical algorithms, basic searching and sorting algorithms and set operations. You learned the types of iterators each algorithm requires and that each algorithm can be used with any container that supports the minimum iterator functionality the algorithm requires. You also learned class `bitset`, which makes it easy to create and manipulate bit sets as a container. Finally, we introduced function objects that work syntactically and semantically like ordinary functions, but offer advantages such as performance and the ability to store data.

In the next chapter, we discuss several more advanced C++ features, including cast operators, namespaces, operator keywords, pointer-to-class-member operators, multiple inheritance and `virtual` base classes.

C++ How to Program (5th Edition)

ISBN: 0131857576

EAN: 2147483647

EAN: 2147483647

Year: 2004

Pages: 627

Pages: 627

Authors: Harvey & Paul) Deitel & Deitel

Simiral book on Amazon

Flylib.com © 2008-2017.

If you may any questions please contact us: flylib@qtcs.net

If you may any questions please contact us: flylib@qtcs.net