Interpretation of sgi stl source code: String

Source: Internet
Author: User

It took almost one day to implement the string of sgi stl to the c ++ standard.ProgramLibrary. Now, let's make a summary.

String is also one of many containers. It complies with the container design interface and is a random reading container (similar to vector, that is, the memory structure is simpler). Its own iterator design is similar to that of vector, all use passed type pointers for iterative operations. String data is stored directly in Allocator, Which is simpler and more straightforward. vector is the space allocated by allocator to manage unallocated space. String supports many operations, which are determined by it as a special Char or w_char container, butCodeIt is easy to understand. There is no particular difficulty, but you need to pay attention to some minor differences, such as the differences between operator [] and.

If you want to explain the string, you need to explain its purpose. The various overloaded versions of the functions are confusing. In addition, the Code is easy to understand, so it is hard to look at them again. Here, the interpretation of string is omitted.

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.