Common capabilities of STL containers
- All containers provide "value semantics" rather than "reference semantics". When an element is placed in a container, the internal copy or move, rather than the reference of the management element.
- Elements have their specific order within the container.
- In general, each operation is not completely secure, and the caller needs to ensure that the arguments passed to the operation function meet the criteria.
Constvector<int> v1 = {1,2,3,4,5,6};//initialize with initial value columnvector<float> V2 (V1.begin (), V1.end ());//Use interval initializationlist<string> L = {"Hello"," World"};vector<string> C1 (Make_move_iterator (L.begin ()), Make_move_iterator (L.end ()));//initializing using the move iteratorintAarray[] = {2,3,7, One, - };Set<int> C2 (Std::begin (Aarray), Std::end (Aarray));//C-style array element initializationvector<float> c3 = Std::move (v2);//with the move constructor initialized, the contents of the container v2 are no longer clear
"C + + standard library" STL container