1.STL (Standard Template Library) is composed of 2 components: container--vector,list,set,map, generic algorithm--find (), sort (), replace (), merge (), etc.
2. When an array is passed to a function, or returned by a function, only the address of the first element is passed: int min (int array[24]) and int min (int *array) are the same.
3. Generic pointer iterator:vector<string>::iterator iter=svec.begin ().
4. Use the Sequential container: (1) Insert the element anywhere in the vector, or delete the element at any position, which is not the end and is very inefficient. But the index is fast. The vector is suitable for use as arrays.
(2) The list is easy to insert and delete, but the index is very slow.
(3) Deque is more efficient for inserting and deleting the most front-end elements.
5.5 ways to define sequential containers
#include <vector>
#include <list>
#include <deque>
(1) An empty container:list<string> IList;
(2) Producing a container of a specific size:list<string> IList (32);
(3) Produce a container of a specific size and specify the initial value:vector<int> Ivec (10,-1) for each element;
(4) Create a container by a pair of iterator: int ia[8]={1,1,2,3,5,8,13,21}; Vector<int> fib (ia,ia+8);
(5) The copy of the container:list<string> slist;
Fill Slist ....
List<string> Slist2 (slist);
6. Operation function of the container
Push_back ();p op_back (); Front (); Back ();
Push_front ();p op_front (); For List,deque only
Iterator Insert (iterator position,eletype value); Inserts a value before the specified position, returning the position of the element
"Essential C + +"--(iii) Generic programming style