Buchdetails
Beschreibung
A good part of this book involves using containers, like vectors and maps, which are built into STL. (Besides the standard built-in containers, the author also highlights recent additions to STL like B-trees, which are available as extensions from other vendors.) You'll learn the best ways to allocate, add, change, and delete items inside containers, including associative containers like maps. You'll also learn to avoid common pitfalls, which can result in writing code that is slow or just plain wrong.
Other areas covered in Effective STL cover getting the most out of the 100-plus STL algorithms that are bundled with this library. Meyers shows you how to choose the correct algorithm for sorting and other functions. (Even advanced developers will learn something here.) Sections on using function objects (called functors) round out the text. Meyers shows you when these classes make sense and the best ways to implement them. Besides specific tips, you'll get plenty of general programming advice. A useful appendix shows the limitations of STL as implemented in Microsoft Visual C++ 6.0 and how to overcome them.
Overall, Effective STL is a really invaluable source of programming expertise on an essential aspect of today's C++ for anyone who is using--or planning to use--STL in real production code. It is quite simply a must-have. --Richard Dragan
Topics covered:
Introduction to advanced Standard Template Library (STL) programming techniques
50 tips and best practices for STL illustrated with sample tutorial code
Choosing containers
Efficient copying of elements inside containers
Removing, erasing, and cleaning up items from containers
Using custom allocators with STL containers
Thread safety with STL
Tips for programming with the STL vector and string classes (including reserving memory and calling legacy C/C++ code)
Tips for associative containers (including comparing items, sorted vectors, and non-standard enhancements to STL)
Tips for selecting and using STL iterator classes
STL algorithms (including sorting, removing, and comparing items)
Using functors with STL
General tips for STL programming (including advice for choosing algorithms and understanding compiler diagnostic messages)
String locales
Overcoming STL imitations in Microsoft Visual C++ 6.0