Simplified STL Chinese version (Full Version)

Source: Internet
Author: User

Finally, I found the complete Chinese version of objective STL and gave it to everyone.
The author explains how to combine STL components to maximize the benefits of library design. This information allows you to develop simple and direct solutions for simple and direct problems, and helps you design elegant methods for more complex problems. I described common STL usage errors and showed you how to avoid them. This helps you avoid transient resource leaks, unportable code, and undefined behaviors. I 've discussed how to optimize the code, so you can make STL behave as fast and smooth as it should.
This book is translated by Scott Meyers.

Original article from center of STL study-the best STL Learning Website
Preface
Thank you
Guide
Container
Clause 1: carefully select your container
Clause 2: Be careful with fantasies about "container-independent code"
Clause 3: Make the copy operation of objects in the container simple and correct
Clause 4: Use empty instead of checking whether size () is 0
Clause 5: Use the interval member function instead of their single-element sibling function"
Clause 6: Be cautious with the most annoying analysis of c ++
Clause 7: when using a new pointer container, remember to delete the pointers before destroying the container.
Clause 8: never create an auto_ptr container
Clause 9: select carefully in the delete option
Clause 10: Pay attention to the agreements and constraints of distributors
Clause 11: Understand the correct usage of a custom distributor
Article 12: expectations for STL container thread security
Vector and string
Clause 13: Use Vector and string instead of dynamically allocated arrays.
Clause 14: use reserve to avoid unnecessary reallocation
Article 15: Be careful with the diversity of string implementations
Article 16: how to transmit data from a vector and a string to a traditional API
Article 17: use swap techniques to Trim excess capacity
Clause 18: Avoid using vector
Associated container
Clause 19: understand the differences between equality and equivalence
Clause 20: specify a comparison type for the container associated with the pointer
Clause 21: always let the comparison function return false for equal values
Clause 22: avoid modifying the set and Multiset keys in the same place
Cla23: Use ordered vector instead of the associated container
Clause 24: When efficiency is concerned, you should carefully select between map: operator [] and map-insert.
Clause 25: familiar with non-standard hashed containers
Iterator
Clause 26: Use iterator instead of const_iterator, reverse_iterator, and const_reverse_iterator.
Article 27: use distance and advance to convert const_iterator into iterator
Article 28: Learn How to Get iterator through reverse_iterator's base
Clause 29: Use istreambuf_iterator when one character is required
Algorithm
Clause 30: ensure that the target range is large enough
Clause 31: Understand your sorting options
Cla32: If you really want to delete something, connect to erase after the remove algorithm.
Cla33: Beware of using remove-like algorithms on Pointer containers
Cla34: Note which algorithm requires an ordered Interval
Article 35: Simple case-insensitive string comparison through mismatch or lexicographical comparison
Article 36: Understand the correct implementation of copy_if
Clause 37: Use accumulate or for_each to calculate the interval
Imitation functions, imitation functions, functions, etc.
Clause 38: design the imitation function class for value transfer
Clause 39: use pure functions as the limit type
Clause 40: Make the imitation function class adaptive
Cla41: Learn why ptr_fun, mem_fun, and mem_fun_ref are used.
Cla42: determine less Operator <
Use STL for programming
Cla43: use an algorithm call instead of a handwritten Loop
Cla44: Use a member function instead of an algorithm of the same name.
Clause 45: note the differences between count, find, binary_search, lower_bound, upper_bound, and interval _range.
Cla46: consider using a function object instead of a function as an algorithm parameter.
Article 47: Avoid writing only code
Clause 48: always # include the appropriate header file
Cla49: Learning to crack compiler diagnostic information related to STL
Article 50: familiarize yourself with STL-related websites
Bibliography
Appendix A: Comparison between region settings and case-insensitive strings
Appendix B: notes on the Microsoft STL Platform
Vocabulary
Index
About This ebook

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.