C ++The functions of the standard library are classified as follows:
- Basic operation support. For example, Memory Allocation Management and runtime type information.
- BothCStandard library. Very few changes were made to minimize the number of system violations.
- String andI/OStream. It includes internationalization, localized character sets, and basic input/output stream operations.
- Container and basic algorithms for providing containers. Container includesVector, list, mapAnd so on. Basic Algorithms include the most common traversal, sorting, and other basic operations.
- Numeric operation.
Tips for using the Standard Library:
- You don't have to re-invent the wheel to do everything and use the library.
- Do not believe in miracles, understand what your database can do, how it will be done, and how much it will cost when it is done.
- When you encounter a choice, you should first select the standard library instead of other libraries.
- Do not think that the standard library is ideal for everything.
- Use# IncludeThe header file of the function you want to use.
- Remember, the features of the standard library are defined in the namespace.Std.
- UseStringInsteadChar *.
- If you suspect it, use a vector that checks the range.
- Vector <T>,List <T>, AndMap <key, value>Better than T.
- To add an element to the container, usePush_backOrBack_inserter ().
- UseVectorOfPush_back ()InsteadRealloc ().
- InMain ()To capture Common exceptions.