Effective STL Programming (English Version)

Author: Scott Meyers (USA)
Publisher:
Publish Date: 2006-08-01
Features: 50 Effective STL Usage Tips
This is the third volume of Effective C++, and it remains outstanding. —Herb Sutter, Chairman of the ISO/ANSI C++ Standards Committee
Few books are essential reading for C++ programmers, and this one is one of them. The C++ Standard Template Library (STL) is revolutionary, but learning to use it effectively is full of challenges. The renowned Taiwanese technical writer, Dr. J. H. Hsieh, once described the process of learning STL in three stages:
Stage 1: Proficient in STL.
Stage 2: Understand the essence of generic programming and the theory and practice of STL.
Stage 3: Extend STL.
This book is undoubtedly the best guide to help you reach Stage 2. Here, C++ authority Scott Meyers reveals key rules summarized by experts, including practices they always follow and pitfalls they always avoid. These rules maximize the utility of STL. Unlike some books that merely describe what STL contains, this one teaches how to use STL. It offers 50 guiding principles, each accompanied by thorough analysis and insightful examples, so readers not only learn what to do but also understand when and why to do it. Like Meyers’ other works, this book is filled with wisdom derived from real-world experience. Its clear, concise, and in-depth style makes it an indispensable reference for every STL programmer.
Advice on container selection, covering:
- Standard STL containers (e.g., `vector` and `list`)
- Non-standard STL containers (e.g., `hash_set` and `hash_map`)
- Non-STL containers (e.g., `bitset`)
Techniques to significantly improve the efficiency of STL (and programs using STL).
The C++ Standard Template Library (STL) is revolutionary, but learning to use it effectively is full of challenges. The renowned Taiwanese technical writer, Dr. J. H. Hsieh, once described the process of learning STL in three stages:
Stage 1: Proficient in STL.
Stage 2: Understand the essence of generic programming and the theory and practice of STL.
Stage 3: Extend STL.
This book is undoubtedly the best guide to help you reach Stage 2. Here, C++ authority Scott Meyers reveals key rules summarized by experts, including practices they always follow and pitfalls they always avoid. These rules maximize the utility of STL. Unlike some books that merely describe what STL contains, this one teaches how to use STL. It offers 50 guiding principles, each accompanied by thorough analysis and insightful examples, so readers not only learn what to do but also understand when and why to do it. Like Meyers’ other works, this book is filled with wisdom derived from real-world experience. Its clear, concise, and in-depth style makes it an indispensable reference for every STL programmer.
Key Features of the Book
- Advice on container selection, covering:
- Standard STL containers (e.g., `vector` and `list`)
- Non-standard STL containers (e.g., `hash_set` and `hash_map`)
- Non-STL containers (e.g., `bitset`)
- Techniques to significantly improve the efficiency of STL (and programs using STL).
- In-depth exploration of iterators, function objects, and allocators (allocators), including practices programmers should always avoid.
- Guidance on algorithms and member functions (e.g., `find`) to ensure they are used correctly, based on their subtle behavioral differences.
- Discussion of potential portability issues and simple ways to avoid them.

📌 Related Posts