C ++ tour-standard library function classification (2)

Source: Internet
Author: User

  C ++The functions of the standard library are classified as follows:

  1. Basic operation support. For example, Memory Allocation Management and runtime type information.
  2. BothCStandard library. Very few changes were made to minimize the number of system violations.
  3. String andI/OStream. It includes internationalization, localized character sets, and basic input/output stream operations.
  4. 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.
  5. Numeric operation.

Tips for using the Standard Library:

  1. You don't have to re-invent the wheel to do everything and use the library.
  2. 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.
  3. When you encounter a choice, you should first select the standard library instead of other libraries.
  4. Do not think that the standard library is ideal for everything.
  5. Use# IncludeThe header file of the function you want to use.
  6. Remember, the features of the standard library are defined in the namespace.Std.
  7. UseStringInsteadChar *.
  8. If you suspect it, use a vector that checks the range.
  9.  Vector <T>,List <T>, AndMap <key, value>Better than T.
  10. To add an element to the container, usePush_backOrBack_inserter ().
  11. UseVectorOfPush_back ()InsteadRealloc ().
  12. InMain ()To capture Common exceptions.

 

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.