"C + + standard library" STL container

Source: Internet
Author: User

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

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.