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.